]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Enable the "Empty Trash" action if items are deleted by non-KDE apps
authorFrank Reininghaus <frank78ac@googlemail.com>
Mon, 21 May 2012 21:15:44 +0000 (23:15 +0200)
committerFrank Reininghaus <frank78ac@googlemail.com>
Mon, 21 May 2012 21:19:08 +0000 (23:19 +0200)
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

index ccf9d8cffc11783cbaf18f5e027976004a65d5f4..968c9af455bacf135089fd519a8888ae2fd6a47e 100644 (file)
@@ -23,7 +23,6 @@
 
 #include "placespanel.h"
 
-#include <KConfigGroup>
 #include <KDebug>
 #include <KDirNotify>
 #include <KIcon>
@@ -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..."));