X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/6072005ddce81b456fdcf2e77d5156a1d86f3686..957cc92f46203f1403a812cbc224123f6b5ed036:/src/dolphincontextmenu.cpp diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index 77c423fb4..d15e668b1 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include #include @@ -164,7 +163,7 @@ void DolphinContextMenu::openTrashItemContextMenu() if (exec(m_pos) == restoreAction) { QList selectedUrls; selectedUrls.reserve(m_selectedItems.count()); - foreach (const KFileItem &item, m_selectedItems) { + for (const KFileItem &item : qAsConst(m_selectedItems)) { selectedUrls.append(item.url()); } @@ -335,11 +334,9 @@ void DolphinContextMenu::openViewportContextMenu() newFileMenu->setPopupFiles(QList() << m_baseUrl); addMenu(newFileMenu->menu()); - // Don't show "Open With" menu items if the current dir is empty, because there's - // generally no app that can do anything interesting with an empty directory - if (view->itemsCount() != 0) { - addOpenWithActions(fileItemActions); - } + // Show "open with" menu items even if the dir is empty, because there are legitimate + // use cases for this, such as opening an empty dir in Kate or VSCode or something + addOpenWithActions(fileItemActions); QAction* pasteAction = createPasteAction(); addAction(pasteAction); @@ -378,7 +375,7 @@ void DolphinContextMenu::insertDefaultItemActions(const KFileItemListProperties& { const KActionCollection* collection = m_mainWindow->actionCollection(); - // Insert 'Cut', 'Copy', 'Copy location' and 'Paste' + // Insert 'Cut', 'Copy', 'Copy Location' and 'Paste' addAction(collection->action(KStandardAction::name(KStandardAction::Cut))); addAction(collection->action(KStandardAction::name(KStandardAction::Copy))); QAction* copyPathAction = collection->action(QString("copy_location"));