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
This commit is contained in:
Rafael Fernández López 2008-03-05 22:25:01 +00:00
parent f34101267c
commit 7244399154

View 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(),