From 0f70b6048037c505b4451aa23e27712f89fc0799 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Mon, 21 May 2012 23:15:44 +0200 Subject: 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 --- src/panels/places/placespanel.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') 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...")); -- cgit v1.3