connect(view, &DolphinView::sortRoleChanged, this, &DolphinViewActionHandler::slotSortRoleChanged);
connect(view, &DolphinView::zoomLevelChanged, this, &DolphinViewActionHandler::slotZoomLevelChanged);
connect(view, &DolphinView::writeStateChanged, this, &DolphinViewActionHandler::slotWriteStateChanged);
+ slotWriteStateChanged(view->isFolderWritable());
connect(view, &DolphinView::selectionModeChangeRequested, this, [this](bool enabled) {
Q_EMIT selectionModeChangeTriggered(enabled);
});
// This action doesn't appear in the GUI, it's for the shortcut only.
// KNewFileMenu takes care of the GUI stuff.
QAction *newDirAction = m_actionCollection->addAction(QStringLiteral("create_dir"));
- newDirAction->setText(i18nc("@action", "Create Folder..."));
+ newDirAction->setText(i18nc("@action", "Create Folder…"));
m_actionCollection->setDefaultShortcuts(newDirAction, KStandardShortcut::createFolder());
newDirAction->setIcon(QIcon::fromTheme(QStringLiteral("folder-new")));
newDirAction->setEnabled(false); // Will be enabled in slotWriteStateChanged(bool) if the current URL is writable
auto trashAction = KStandardAction::moveToTrash(this, &DolphinViewActionHandler::slotTrashActivated, m_actionCollection);
auto trashShortcuts = trashAction->shortcuts();
+ trashAction->setAutoRepeat(false);
if (!trashShortcuts.contains(QKeySequence::Delete)) {
trashShortcuts.append(QKeySequence::Delete);
m_actionCollection->setDefaultShortcuts(trashAction, trashShortcuts);
auto deleteAction = KStandardAction::deleteFile(this, &DolphinViewActionHandler::slotDeleteItems, m_actionCollection);
auto deleteShortcuts = deleteAction->shortcuts();
+ deleteAction->setAutoRepeat(false);
if (!deleteShortcuts.contains(Qt::SHIFT | Qt::Key_Delete)) {
deleteShortcuts.append(Qt::SHIFT | Qt::Key_Delete);
m_actionCollection->setDefaultShortcuts(deleteAction, deleteShortcuts);
viewModeActions->addAction(compactAction);
viewModeActions->addAction(detailsAction);
viewModeActions->setToolBarMode(KSelectAction::MenuMode);
- connect(viewModeActions, &KSelectAction::triggered, this, &DolphinViewActionHandler::slotViewModeActionTriggered);
+ connect(viewModeActions, &KSelectAction::actionTriggered, this, &DolphinViewActionHandler::slotViewModeActionTriggered);
QAction *zoomInAction = KStandardAction::zoomIn(this, &DolphinViewActionHandler::zoomIn, m_actionCollection);
zoomInAction->setWhatsThis(i18nc("@info:whatsthis zoom in", "This increases the icon size."));
connect(showHiddenFiles, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleShowHiddenFiles);
QAction *adjustViewProps = m_actionCollection->addAction(QStringLiteral("view_properties"));
- adjustViewProps->setText(i18nc("@action:inmenu View", "Adjust View Display Style..."));
+ adjustViewProps->setText(i18nc("@action:inmenu View", "Adjust View Display Style…"));
adjustViewProps->setIcon(QIcon::fromTheme(QStringLiteral("view-choose")));
adjustViewProps->setWhatsThis(i18nc("@info:whatsthis",
"This opens a window "
// actions and the sub-menu-actions. If an action gets checked, it must
// be assured that all other actions get unchecked, except the ascending/
// descending actions
- for (QAction *groupAction : qAsConst(m_sortByActions)) {
+ for (QAction *groupAction : std::as_const(m_sortByActions)) {
KActionMenu *actionMenu = qobject_cast<KActionMenu *>(groupAction);
if (actionMenu) {
const auto actions = actionMenu->menu()->actions();
}
}
}
+
+#include "moc_dolphinviewactionhandler.cpp"