]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphincontextmenu.cpp
Allow zooming in and zooming out in the icons view.
[dolphin.git] / src / dolphincontextmenu.cpp
index 7f34bafd31042c3854d1d303f7b0a876975a814f..346ee64013fc9bd327c1350609f11aaccceb3849 100644 (file)
@@ -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);
     }
@@ -317,8 +324,7 @@ QList<QAction*> 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::OnlyLocals);
-            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;