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);
}
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);
}
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();
}
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()) {