diff options
author | Ken Moore <ken@pcbsd.org> | 2015-05-28 11:59:50 -0400 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-05-28 11:59:50 -0400 |
commit | ea4124dc0452413c6ce323cfa339466a221e5bbb (patch) | |
tree | 90e5d11d289a23d4fd918c75bd49efd35a35fe67 /lumina-desktop/panel-plugins/userbutton | |
parent | Allow the desktopview plugin the ability to remove directories as well (not j... (diff) | |
download | lumina-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/panel-plugins/userbutton')
-rw-r--r-- | lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp | 12 |
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(); } } |