]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinpart.cpp
differ between pasting one folder, pasting one file and pasting n items
[dolphin.git] / src / dolphinpart.cpp
index 16caae9d69e85339bfc06ef3bdfe3f625320e73a..0ea761d2d1ede3e5758f1c90c0330d89dbcc6de6 100644 (file)
@@ -54,7 +54,7 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QStringLi
 
     m_dirLister = new KDirLister;
     m_dirLister->setAutoUpdate(true);
-    m_dirLister->setMainWindow(parentWidget->topLevelWidget());
+    m_dirLister->setMainWindow(parentWidget->window());
     m_dirLister->setDelayedMimeTypes(true);
 
     //connect(m_dirLister, SIGNAL(started(KUrl)), this, SLOT(slotStarted()));
@@ -273,7 +273,7 @@ void DolphinPart::slotItemTriggered(const KFileItem& item)
     } else {
         // Left button. [Right button goes to slotOpenContextMenu before triggered can be emitted]
         kDebug() << "LMB";
-        emit m_extension->openUrlRequest(item.url(), args, browserArgs);
+        emit m_extension->openUrlRequest(item.targetUrl(), args, browserArgs);
     }
 }
 
@@ -327,7 +327,10 @@ void DolphinPart::slotOpenContextMenu(const KFileItem& _item, const KUrl&)
             editActions.append(actionCollection()->action("delete"));
         actionGroups.insert("editactions", editActions);
 
-        KFileItemList items; items.append(item);
+        // TODO: We should change the signature of the slots (and signals) for being able
+        //       to tell for which items we want a popup.
+        KFileItemList items = (m_view->selectedItems().count() ? m_view->selectedItems()
+                                                               : KFileItemList() << item);
         emit m_extension->popupMenu(QCursor::pos(),
                                     items,
                                     KParts::OpenUrlArguments(),