X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/3ebd1027a23502a30a821d27b1f9946dcd595543..ad01ddac1a104b8f372a98db84f123fbba65e2da:/src/dolphincontextmenu.cpp diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index d27aa99cd..346ee6401 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -151,13 +151,20 @@ 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' + const KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::NoGlobals); + const KConfigGroup kdeConfig(globalConfig, "KDE"); + bool showDeleteCommand = kdeConfig.readEntry("ShowDeleteCommand", false); 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); }