X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/1bed1753d2692d8bd5922928db9a65e40165b906..b5cc2a6924cfd8f59611d3cec2edbb00a08b4ff1:/src/dolphincontextmenu.cpp diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index 087211686..147606581 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -97,7 +97,7 @@ void DolphinContextMenu::openViewportContextMenu() popup->addMenu(viewModeMenu); popup->addSeparator(); - QAction* bookmarkAction = popup->addAction(i18n("Bookmark this folder")); + QAction* bookmarkAction = popup->addAction(KIcon("bookmark-folder"), i18n("Bookmark this folder")); popup->addSeparator(); QAction* propertiesAction = popup->addAction(i18n("Properties...")); @@ -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); } @@ -167,7 +174,7 @@ void DolphinContextMenu::openItemContextMenu() // urls contains only one item, i.e. no multiple selection made QAction* bookmarkAction = 0; if (m_fileInfo->isDir() && (urls.count() == 1)) { - bookmarkAction = popup->addAction(i18n("Bookmark this folder")); + bookmarkAction = popup->addAction(KIcon("bookmark-folder"), i18n("Bookmark this folder")); } // Insert 'Open With...' sub menu @@ -317,8 +324,7 @@ QList DolphinContextMenu::insertActionItems(KMenu* popup, QStringList entries = dir.entryList(QDir::Files); for (QStringList::ConstIterator entryIt = entries.begin(); entryIt != entries.end(); ++entryIt) { - KConfig cfg(*dirIt + *entryIt, KConfig::OnlyLocal); - cfg.setDesktopGroup(); + KConfigGroup cfg(KSharedConfig::openConfig( *dirIt + *entryIt, KConfig::OnlyLocal), "Desktop Entry" ); if ((cfg.hasKey("Actions") || cfg.hasKey("X-KDE-GetActionMenu")) && cfg.hasKey("ServiceTypes")) { //const QStringList types = cfg.readListEntry("ServiceTypes"); QStringList types;