aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-05-28 11:59:50 -0400
committerKen Moore <ken@pcbsd.org>2015-05-28 11:59:50 -0400
commitea4124dc0452413c6ce323cfa339466a221e5bbb (patch)
tree90e5d11d289a23d4fd918c75bd49efd35a35fe67 /lumina-desktop
parentAllow the desktopview plugin the ability to remove directories as well (not j... (diff)
downloadlumina-ea4124dc0452413c6ce323cfa339466a221e5bbb.tar.gz
lumina-ea4124dc0452413c6ce323cfa339466a221e5bbb.tar.bz2
lumina-ea4124dc0452413c6ce323cfa339466a221e5bbb.zip
Add the ability to remove directories from the desktop via the user button as well.
Diffstat (limited to 'lumina-desktop')
-rw-r--r--lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
index 1cceb5e2..fccb518f 100644
--- a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
+++ b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
@@ -112,7 +112,7 @@ void UserItemWidget::setupButton(bool disable){
button->setIcon( LXDG::findIcon("list-remove","") );
button->setToolTip(tr("Remove Shortcut"));
connect(button, SIGNAL(clicked()), this, SLOT(buttonClicked()) );
- }else if(isShortcut && !isDirectory){ //Physical File - can remove
+ }else if(isShortcut){ //Physical File/Dir - can remove
button->setWhatsThis("remove");
button->setIcon( LXDG::findIcon("user-trash","") );
button->setToolTip(tr("Delete File"));
@@ -139,8 +139,14 @@ void UserItemWidget::buttonClicked(){
//QFile::link(icon->whatsThis(), QDir::homePath()+"/.lumina/favorites/"+icon->whatsThis().section("/",-1) );
emit NewShortcut();
}else if(button->whatsThis()=="remove"){
- if(linkPath.isEmpty()){ QFile::remove(icon->whatsThis()); } //This is a desktop file
- else{ LUtils::removeFavorite(icon->whatsThis()); } //This is a favorite
+ if(linkPath.isEmpty()){
+ //This is a desktop file
+ if(isDirectory){
+ QProcess::startDetached("rm -r \""+icon->whatsThis()+"\"");
+ }else{
+ QFile::remove(icon->whatsThis());
+ }
+ }else{ LUtils::removeFavorite(icon->whatsThis()); } //This is a favorite
emit RemovedShortcut();
}
}
bgstack15