From edced8460bb19bfdce54cb819a3119b637463494 Mon Sep 17 00:00:00 2001 From: Domenico Panella Date: Sat, 29 Aug 2020 16:12:47 +0200 Subject: [PATCH] Allow folder creation on desktop via F10 shortcut --- src/views/dolphinviewactionhandler.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp index a2cb89a58..af1055129 100644 --- a/src/views/dolphinviewactionhandler.cpp +++ b/src/views/dolphinviewactionhandler.cpp @@ -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); -- GitLab