diff options
-rw-r--r-- | lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp | 6 | ||||
-rw-r--r-- | lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp index 467b802b..991abf2e 100644 --- a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp +++ b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp @@ -97,7 +97,11 @@ void DesktopViewPlugin::cutItems(){ void DesktopViewPlugin::deleteItems(){ QList<QListWidgetItem*> sel = list->selectedItems(); for(int i=0; i<sel.length(); i++){ - QFile::remove(sel[i]->whatsThis()); + if(QFileInfo(sel[i]->whatsThis()).isDir()){ + QProcess::startDetached("rm -r \""+sel[i]->whatsThis()+"\""); + }else{ + QFile::remove(sel[i]->whatsThis()); + } } } 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(); } } |