X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/39fcc8945051365ae240e0bf92fcb3403d77caed..d1acb1d56e18f4adef3eba7fc61facb1db5deb75:/src/dolphincontextmenu.cpp diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index 7ee9562ae..881ef34b4 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -124,7 +124,7 @@ DolphinContextMenu::Command DolphinContextMenu::open() void DolphinContextMenu::keyPressEvent(QKeyEvent *ev) { if (m_removeAction && ev->key() == Qt::Key_Shift) { - m_removeAction->update(); + m_removeAction->update(DolphinRemoveAction::ShiftState::Pressed); } QMenu::keyPressEvent(ev); } @@ -132,7 +132,7 @@ void DolphinContextMenu::keyPressEvent(QKeyEvent *ev) void DolphinContextMenu::keyReleaseEvent(QKeyEvent *ev) { if (m_removeAction && ev->key() == Qt::Key_Shift) { - m_removeAction->update(); + m_removeAction->update(DolphinRemoveAction::ShiftState::Released); } QMenu::keyReleaseEvent(ev); } @@ -369,11 +369,16 @@ void DolphinContextMenu::openViewportContextMenu() QAction* action = exec(m_pos); if (addToPlacesAction && (action == addToPlacesAction)) { const DolphinViewContainer* container = m_mainWindow->activeViewContainer(); - if (container->url().isValid()) { + const QUrl url = container->url(); + if (url.isValid()) { PlacesItemModel model; - PlacesItem* item = model.createPlacesItem(container->placesText(), - container->url(), - KIO::iconNameForUrl(container->url())); + QString icon; + if (container->isSearchModeEnabled()) { + icon = QStringLiteral("folder-saved-search-symbolic"); + } else { + icon = KIO::iconNameForUrl(url); + } + PlacesItem* item = model.createPlacesItem(container->placesText(), url, icon); model.appendItemToGroup(item); model.saveBookmarks(); } @@ -392,8 +397,7 @@ void DolphinContextMenu::insertDefaultItemActions(const KFileItemListProperties& addSeparator(); // Insert 'Rename' - QAction* renameAction = collection->action(QStringLiteral("rename")); - addAction(renameAction); + addAction(collection->action(KStandardAction::name(KStandardAction::RenameFile))); // Insert 'Move to Trash' and/or 'Delete' if (properties.supportsDeleting()) {