]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix a crash when right clicking on the viewport and no items selected.
authorRafael Fernández López <ereslibre@kde.org>
Wed, 5 Mar 2008 22:25:01 +0000 (22:25 +0000)
committerRafael Fernández López <ereslibre@kde.org>
Wed, 5 Mar 2008 22:25:01 +0000 (22:25 +0000)
CCMAIL: edulix@gmail.com

svn path=/trunk/KDE/kdebase/apps/; revision=782768

src/dolphinpart.cpp

index aa1bb6d7c419f3da13ff34ba68291fd6a3e5a60a..0ea761d2d1ede3e5758f1c90c0330d89dbcc6de6 100644 (file)
@@ -327,7 +327,10 @@ void DolphinPart::slotOpenContextMenu(const KFileItem& _item, const KUrl&)
             editActions.append(actionCollection()->action("delete"));
         actionGroups.insert("editactions", editActions);
 
-        KFileItemList items = m_view->selectedItems();
+        // 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(),