┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphincontextmenu.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-02-25 20:51:05 +0000
committerPeter Penz <[email protected]>2007-02-25 20:51:05 +0000
commitd9c3648d5a4601d8e11e148ca77b3e9d84cf3207 (patch)
treec330de8ad239606f81a3bd7ac02c55fb340d0716 /src/dolphincontextmenu.cpp
parent7a34c3321d1d36a9b20fb9116b33b8c8a9181e82 (diff)
Implemented one of the most often requested features for Dolphin: allow that the command 'Delete' is shown in the context menu to bypass the trash. Like in Konqueror the default setting is that the 'Delete' command is not shown. TODO: currently this is a custom setting of Dolphin. Konqueror uses the global settings from KDE for this -> should this be changed to use the global setting instead?
svn path=/trunk/KDE/kdebase/apps/; revision=637232
Diffstat (limited to 'src/dolphincontextmenu.cpp')
-rw-r--r--src/dolphincontextmenu.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp
index d27aa99cd..14f71f449 100644
--- a/src/dolphincontextmenu.cpp
+++ b/src/dolphincontextmenu.cpp
@@ -25,6 +25,8 @@
#include "dolphinview.h"
#include "editbookmarkdialog.h"
+#include "dolphin_generalsettings.h"
+
#include <assert.h>
#include <kactioncollection.h>
@@ -151,13 +153,18 @@ void DolphinContextMenu::openItemContextMenu()
QAction* renameAction = dolphin->actionCollection()->action("rename");
popup->addAction(renameAction);
- // insert 'Move to Trash' for local Urls, otherwise insert 'Delete'
+ // insert 'Move to Trash' and (optionally) 'Delete'
+ bool showDeleteCommand = DolphinSettings::instance().generalSettings()->showDeleteCommand();
const KUrl& url = dolphin->activeView()->url();
if (url.isLocalFile()) {
QAction* moveToTrashAction = dolphin->actionCollection()->action("move_to_trash");
popup->addAction(moveToTrashAction);
}
else {
+ showDeleteCommand = true;
+ }
+
+ if (showDeleteCommand) {
QAction* deleteAction = dolphin->actionCollection()->action("delete");
popup->addAction(deleteAction);
}