From d9c3648d5a4601d8e11e148ca77b3e9d84cf3207 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 25 Feb 2007 20:51:05 +0000 Subject: 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 --- src/dolphincontextmenu.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/dolphincontextmenu.cpp') 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 #include @@ -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); } -- cgit v1.3