]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphincontextmenu.cpp
Internal cleanup: Remove some public toggle-slots from DolphinView. Setters- and...
[dolphin.git] / src / dolphincontextmenu.cpp
index ae5bf8698aff97562b840220e7b28b60dc0ab36c..13fa6f35b9ec33e6aeecf20579641e7b248d9ec6 100644 (file)
@@ -74,8 +74,10 @@ DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent,
     // The context menu either accesses the URLs of the selected items
     // or the items itself. To increase the performance both lists are cached.
     const DolphinView* view = m_mainWindow->activeViewContainer()->view();
-    m_selectedUrls = view->selectedUrls();
     m_selectedItems = view->selectedItems();
+    foreach (const KFileItem &item, m_selectedItems) {
+        m_selectedUrls.append(item.url());
+    }
 
     if (m_keyInfo != 0) {
         if (m_keyInfo->isKeyPressed(Qt::Key_Shift) || m_keyInfo->isKeyLatched(Qt::Key_Shift)) {
@@ -325,6 +327,14 @@ void DolphinContextMenu::openViewportContextMenu()
     // "open_in_new_tab" here, as the current selection should get ignored.
     m_popup->addAction(m_mainWindow->actionCollection()->action("new_window"));
     m_popup->addAction(m_mainWindow->actionCollection()->action("new_tab"));
+
+    // Insert 'Add to Places' entry if exactly one item is selected
+    QAction* addToPlacesAction = 0;
+    if (!placeExists(m_mainWindow->activeViewContainer()->url())) {
+        addToPlacesAction = m_popup->addAction(KIcon("bookmark-new"),
+                                             i18nc("@action:inmenu Add current folder to places", "Add to Places"));
+    }
+
     m_popup->addSeparator();
 
     QAction* pasteAction = createPasteAction();
@@ -340,13 +350,6 @@ void DolphinContextMenu::openViewportContextMenu()
 
     addVersionControlActions();
 
-    // insert 'Add to Places' entry if exactly one item is selected
-    QAction* addToPlacesAction = 0;
-    if (!placeExists(m_mainWindow->activeViewContainer()->url())) {
-        addToPlacesAction = m_popup->addAction(KIcon("bookmark-new"),
-                                             i18nc("@action:inmenu Add current folder to places", "Add to Places"));
-    }
-
     addCustomActions();
 
     QAction* propertiesAction = m_popup->addAction(i18nc("@action:inmenu", "Properties"));