Commit edced846 authored by Domenico Panella's avatar Domenico Panella Committed by Nate Graham
Browse files

Allow folder creation on desktop via F10 shortcut

parent a3c0a822
...@@ -78,8 +78,12 @@ void DolphinViewActionHandler::createActions() ...@@ -78,8 +78,12 @@ void DolphinViewActionHandler::createActions()
// KNewFileMenu takes care of the GUI stuff. // KNewFileMenu takes care of the GUI stuff.
QAction* newDirAction = m_actionCollection->addAction(QStringLiteral("create_dir")); QAction* newDirAction = m_actionCollection->addAction(QStringLiteral("create_dir"));
newDirAction->setText(i18nc("@action", "Create Folder...")); newDirAction->setText(i18nc("@action", "Create Folder..."));
m_actionCollection->setDefaultShortcut(newDirAction, Qt::Key_F10); #if KCONFIG_VERSION >= QT_VERSION_CHECK(5, 74, 0)
newDirAction->setIcon(QIcon::fromTheme(QStringLiteral("folder-new"))); 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 newDirAction->setEnabled(false); // Will be enabled in slotWriteStateChanged(bool) if the current URL is writable
connect(newDirAction, &QAction::triggered, this, &DolphinViewActionHandler::createDirectoryTriggered); connect(newDirAction, &QAction::triggered, this, &DolphinViewActionHandler::createDirectoryTriggered);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment