From: Rafael Fernández López Date: Wed, 5 Mar 2008 22:25:01 +0000 (+0000) Subject: Fix a crash when right clicking on the viewport and no items selected. X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/7244399154e1e638e9f9a76fbc799e210942ff5d Fix a crash when right clicking on the viewport and no items selected. CCMAIL: edulix@gmail.com svn path=/trunk/KDE/kdebase/apps/; revision=782768 --- diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index aa1bb6d7c..0ea761d2d 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -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(),