m_baseUrl(baseUrl),
m_baseFileItem(0),
m_selectedItems(),
- m_selectedItemsProperties(0),
+ m_selectedItemsProperties(nullptr),
m_context(NoContext),
m_copyToMenu(parent),
m_customActions(),
DolphinContextMenu::~DolphinContextMenu()
{
delete m_selectedItemsProperties;
- m_selectedItemsProperties = 0;
+ m_selectedItemsProperties = nullptr;
}
void DolphinContextMenu::setCustomActions(const QList<QAction*>& actions)
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);
}
{
Q_ASSERT(!m_fileInfo.isNull());
- QAction* openParentAction = 0;
- QAction* openParentInNewWindowAction = 0;
- QAction* openParentInNewTabAction = 0;
- QAction* addToPlacesAction = 0;
+ QAction* openParentAction = nullptr;
+ QAction* openParentInNewWindowAction = nullptr;
+ QAction* openParentInNewTabAction = nullptr;
+ QAction* addToPlacesAction = nullptr;
const KFileItemListProperties& selectedItemsProps = selectedItemsProperties();
if (m_selectedItems.count() == 1) {
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()) {