]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/treeviewcontextmenu.cpp
Fixed issue that the "Show 'Delete' command in context menu" setting is not remembere...
[dolphin.git] / src / treeviewcontextmenu.cpp
index f4469776bb0ef30ffd2689e616689edcd78e0b06..b53241b18ecebb99599b08e96e1ac0b80512214d 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "treeviewcontextmenu.h"
 
+#include <kfileitem.h>
 #include <kiconloader.h>
 #include <kio/deletejob.h>
 #include <kmenu.h>
@@ -74,7 +75,7 @@ void TreeViewContextMenu::open()
     popup->addAction(renameAction);
 
     // insert 'Move to Trash' and (optionally) 'Delete'
-    const KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::NoGlobals);
+    const KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals");
     const KConfigGroup kdeConfig(globalConfig, "KDE");
     bool showDeleteCommand = kdeConfig.readEntry("ShowDeleteCommand", false);
     const KUrl& url = m_fileInfo.url();
@@ -139,14 +140,15 @@ void TreeViewContextMenu::paste()
 
 void TreeViewContextMenu::rename()
 {
-    const KUrl& oldUrl = m_fileInfo.url();
-    RenameDialog dialog(oldUrl);
+    KFileItemList item;
+    item.append(m_fileInfo);
+    RenameDialog dialog(item);
     if (dialog.exec() == QDialog::Accepted) {
         const QString& newName = dialog.newName();
         if (!newName.isEmpty()) {
-            KUrl newUrl = oldUrl;
+            KUrl newUrl = m_fileInfo.url();
             newUrl.setFileName(newName);
-            KonqOperations::rename(m_parent, oldUrl, newUrl);
+            KonqOperations::rename(m_parent, m_fileInfo.url(), newUrl);
         }
     }
 }