┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
authorDomenico Panella <[email protected]>2020-08-29 16:12:47 +0200
committerNate Graham <[email protected]>2020-11-17 16:18:54 +0000
commitedced8460bb19bfdce54cb819a3119b637463494 (patch)
tree5f71b08e03cda9c554ac7d0e4cc9c71e767ecb7d /src/views
parenta3c0a822caf2c40ea74ed373d3a93f4cb1c0f8c7 (diff)
Allow folder creation on desktop via F10 shortcut
Diffstat (limited to 'src/views')
-rw-r--r--src/views/dolphinviewactionhandler.cpp8
1 files 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);