]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphincontextmenu.cpp
## Summary
[dolphin.git] / src / dolphincontextmenu.cpp
index 79143d400aac68924f8e09dbd4edc542ee33e59c..912caf859b8181a34b95405f18e6db9aa8e828b7 100644 (file)
@@ -342,12 +342,6 @@ void DolphinContextMenu::openViewportContextMenu()
     fileItemActions.setParentWidget(m_mainWindow);
     fileItemActions.setItemListProperties(baseUrlProperties);
 
-    // Don't show "Open With" menu items if the current dir is empty, because there's
-    // generally no app that can do anything interesting with an empty directory
-    if (view->itemsCount() != 0) {
-        addOpenWithActions(fileItemActions);
-    }
-
     // Set up and insert 'Create New' menu
     KNewFileMenu* newFileMenu = m_mainWindow->newFileMenu();
     newFileMenu->setViewShowsHiddenFiles(view->hiddenFilesShown());
@@ -355,6 +349,12 @@ void DolphinContextMenu::openViewportContextMenu()
     newFileMenu->setPopupFiles(QList<QUrl>() << m_baseUrl);
     addMenu(newFileMenu->menu());
 
+    // Don't show "Open With" menu items if the current dir is empty, because there's
+    // generally no app that can do anything interesting with an empty directory
+    if (view->itemsCount() != 0) {
+        addOpenWithActions(fileItemActions);
+    }
+
     QAction* pasteAction = createPasteAction();
     addAction(pasteAction);
 
@@ -392,10 +392,14 @@ void DolphinContextMenu::insertDefaultItemActions(const KFileItemListProperties&
 {
     const KActionCollection* collection = m_mainWindow->actionCollection();
 
-    // Insert 'Cut', 'Copy' and 'Paste'
+    // Insert 'Cut', 'Copy', 'Copy location' and 'Paste'
     addAction(collection->action(KStandardAction::name(KStandardAction::Cut)));
     addAction(collection->action(KStandardAction::name(KStandardAction::Copy)));
+    QAction* copyPathAction = collection->action(QString("copy_location"));
+    copyPathAction->setEnabled(m_selectedItems.size() == 1);
+    addAction(copyPathAction);
     addAction(createPasteAction());
+    addAction(m_mainWindow->actionCollection()->action(QStringLiteral("duplicate")));
 
     addSeparator();