From: Frank Reininghaus Date: Mon, 21 May 2012 21:15:44 +0000 (+0200) Subject: Enable the "Empty Trash" action if items are deleted by non-KDE apps X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/0f70b6048037c505b4451aa23e27712f89fc0799?ds=inline Enable the "Empty Trash" action if items are deleted by non-KDE apps To achieve this, the Places Panel context menu now checks the icon of the "Trash" item (which is updated by a dir lister that watches the state of the trash), rather then reading a config file which is only used by KDE applications. BUG: 293651 FIXED-IN: 4.9.0 --- diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index ccf9d8cff..968c9af45 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -23,7 +23,6 @@ #include "placespanel.h" -#include #include #include #include @@ -157,8 +156,7 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos) } else { if (item->url() == KUrl("trash:/")) { emptyTrashAction = menu.addAction(KIcon("trash-empty"), i18nc("@action:inmenu", "Empty Trash")); - KConfig trashConfig("trashrc", KConfig::SimpleConfig); - emptyTrashAction->setEnabled(!trashConfig.group("Status").readEntry("Empty", true)); + emptyTrashAction->setEnabled(item->icon() == "user-trash-full"); menu.addSeparator(); } addAction = menu.addAction(KIcon("document-new"), i18nc("@item:inmenu", "Add Entry..."));