From c94276725b1452d9f899dec192a8e66ecb9a516d Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 2 Dec 2006 21:51:36 +0000 Subject: reanimated the context menu svn path=/trunk/playground/utils/dolphin/; revision=609962 --- src/dolphincontextmenu.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/dolphincontextmenu.cpp') diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index 1da2443db..53bc09558 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -273,12 +273,11 @@ QList DolphinContextMenu::insertOpenWithItems(KMenu* popup, // are listed which are registered to open the item. As last entry "Other..." will be // attached which allows to select a custom application. If no applications are registered // no sub menu is created at all, only "Open With..." will be offered. - const KFileItemList* list = m_dolphinView->selectedItems(); - assert(list != 0); + const KFileItemList list = m_dolphinView->selectedItems(); bool insertOpenWithItems = true; const QString contextMimeType(m_fileInfo->mimetype()); - QListIterator mimeIt(*list); + QListIterator mimeIt(list); while (insertOpenWithItems && mimeIt.hasNext()) { KFileItem* item = mimeIt.next(); insertOpenWithItems = (contextMimeType == item->mimetype()); @@ -359,10 +358,9 @@ QList DolphinContextMenu::insertActionItems(KMenu* popup, if ((*it) == "all/allfiles") { // The service type is valid for all files, but not for directories. // Check whether the selected items only consist of files... - const KFileItemList* list = m_dolphinView->selectedItems(); - assert(list != 0); + const KFileItemList list = m_dolphinView->selectedItems(); - QListIterator mimeIt(*list); + QListIterator mimeIt(list); insert = true; while (insert && mimeIt.hasNext()) { KFileItem* item = mimeIt.next(); @@ -374,10 +372,9 @@ QList DolphinContextMenu::insertActionItems(KMenu* popup, // Check whether the MIME types of all selected files match // to the mimetype of the service action. As soon as one MIME // type does not match, no service menu is shown at all. - const KFileItemList* list = m_dolphinView->selectedItems(); - assert(list != 0); + const KFileItemList list = m_dolphinView->selectedItems(); - QListIterator mimeIt(*list); + QListIterator mimeIt(list); insert = true; while (insert && mimeIt.hasNext()) { KFileItem* item = mimeIt.next(); -- cgit v1.3