]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Allow folder creation on desktop via F10 shortcut
authorDomenico Panella <pandom79@gmail.com>
Sat, 29 Aug 2020 14:12:47 +0000 (16:12 +0200)
committerNate Graham <nate@kde.org>
Tue, 17 Nov 2020 16:18:54 +0000 (16:18 +0000)
src/views/dolphinviewactionhandler.cpp

index a2cb89a585f2458502ee967c06b81bca69c8089c..af105512976b98b5c37bbb3a2f2c21a27588e592 100644 (file)
@@ -78,8 +78,12 @@ void DolphinViewActionHandler::createActions()
     // KNewFileMenu takes care of the GUI stuff.
     QAction* newDirAction = m_actionCollection->addAction(QStringLiteral("create_dir"));
     newDirAction->setText(i18nc("@action", "Create Folder..."));
-    m_actionCollection->setDefaultShortcut(newDirAction, Qt::Key_F10);
-    newDirAction->setIcon(QIcon::fromTheme(QStringLiteral("folder-new")));
+       #if KCONFIG_VERSION >= QT_VERSION_CHECK(5, 74, 0)
+               m_actionCollection->setDefaultShortcuts(newDirAction, KStandardShortcut::createFolder());
+       #else
+           m_actionCollection->setDefaultShortcut(newDirAction, Qt::Key_F10);
+       #endif
+       newDirAction->setIcon(QIcon::fromTheme(QStringLiteral("folder-new")));
     newDirAction->setEnabled(false);    // Will be enabled in slotWriteStateChanged(bool) if the current URL is writable
     connect(newDirAction, &QAction::triggered, this, &DolphinViewActionHandler::createDirectoryTriggered);