]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinviewactionhandler.cpp
Enable custom view properties for special folders even if "remember for each folder...
[dolphin.git] / src / views / dolphinviewactionhandler.cpp
index 4408a9e4785a72e14643971b1c0ab448a462a94c..ae01437bacdc026ae78c81acf216eb401fd1a1d6 100644 (file)
@@ -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);
     });
@@ -248,6 +249,7 @@ void DolphinViewActionHandler::createActions(SelectionMode::ActionTextHelper *ac
                                      "contents.<nl/>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<KToggleAction>(QStringLiteral("folders_first"));
@@ -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<KActionMenu *>(groupAction);
         if (actionMenu) {
             const auto actions = actionMenu->menu()->actions();