X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/c31d60e630dfa5a03932b1ba33a6f08942ec3cd3..3a03f86b836e172001120ee73956a7bad9c7276b:/src/views/dolphinviewactionhandler.cpp
diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp
index d30464626..ae01437ba 100644
--- a/src/views/dolphinviewactionhandler.cpp
+++ b/src/views/dolphinviewactionhandler.cpp
@@ -60,6 +60,7 @@ void DolphinViewActionHandler::setCurrentView(DolphinView *view)
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);
});
@@ -77,7 +78,7 @@ void DolphinViewActionHandler::createActions(SelectionMode::ActionTextHelper *ac
// 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
@@ -248,6 +249,7 @@ void DolphinViewActionHandler::createActions(SelectionMode::ActionTextHelper *ac
"contents.For example the icons of images become scaled "
"down versions of the images."));
showPreview->setIcon(QIcon::fromTheme(QStringLiteral("view-preview")));
+ m_actionCollection->setDefaultShortcut(showPreview, QKeySequence(Qt::Key_F12));
connect(showPreview, &KToggleAction::triggered, this, &DolphinViewActionHandler::togglePreview);
KToggleAction *sortFoldersFirst = m_actionCollection->add(QStringLiteral("folders_first"));
@@ -327,7 +329,7 @@ void DolphinViewActionHandler::createActions(SelectionMode::ActionTextHelper *ac
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 "
@@ -714,7 +716,7 @@ void DolphinViewActionHandler::slotSortTriggered(QAction *action)
// 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(groupAction);
if (actionMenu) {
const auto actions = actionMenu->menu()->actions();
@@ -820,3 +822,5 @@ void DolphinViewActionHandler::slotSelectionChanged(const KFileItemList &selecti
}
}
}
+
+#include "moc_dolphinviewactionhandler.cpp"