X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/c12dc996f535f787ab828560068a2c8b7f98c5cf..3c74d908de8efc8e2578a69b528370c40bae7ca4:/src/dolphinpart.cpp diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index 479b80951..6f84ab1d8 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -25,26 +25,22 @@ #include #include -#include #include -#include #include -#include +#include #include #include #include -#include -#include #include #include #include -#include +#include #include -#include #include +#include +#include #include "dolphinpart_ext.h" - #include "dolphinnewfilemenu.h" #include "views/dolphinview.h" #include "views/dolphinviewactionhandler.h" @@ -53,11 +49,13 @@ #include "kitemviews/kfileitemmodel.h" #include "kitemviews/private/kfileitemmodeldirlister.h" +#include #include +#include #include #include #include -#include + K_PLUGIN_FACTORY(DolphinPartFactory, registerPlugin();) K_EXPORT_PLUGIN(DolphinPartFactory("dolphinpart", "dolphin")) @@ -178,7 +176,7 @@ void DolphinPart::createActions() QAction* selectItemsMatching = actionCollection()->addAction("select_items_matching"); selectItemsMatching->setText(i18nc("@action:inmenu Edit", "Select Items Matching...")); - selectItemsMatching->setShortcut(Qt::CTRL | Qt::Key_S); + actionCollection()->setDefaultShortcut(selectItemsMatching, Qt::CTRL | Qt::Key_S); connect(selectItemsMatching, &QAction::triggered, this, &DolphinPart::slotSelectItemsMatchingPattern); QAction* unselectItemsMatching = actionCollection()->addAction("unselect_items_matching"); @@ -193,7 +191,7 @@ void DolphinPart::createActions() QAction* invertSelection = actionCollection()->addAction("invert_selection"); invertSelection->setText(i18nc("@action:inmenu Edit", "Invert Selection")); - invertSelection->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_A); + actionCollection()->setDefaultShortcut(invertSelection, Qt::CTRL | Qt::SHIFT | Qt::Key_A); connect(invertSelection, &QAction::triggered, m_view, &DolphinView::invertSelection); // View menu: all done by DolphinViewActionHandler @@ -223,7 +221,7 @@ void DolphinPart::createActions() // Tools menu m_findFileAction = actionCollection()->addAction("find_file"); m_findFileAction->setText(i18nc("@action:inmenu Tools", "Find File...")); - m_findFileAction->setShortcut(Qt::CTRL | Qt::Key_F); + actionCollection()->setDefaultShortcut(m_findFileAction, Qt::CTRL | Qt::Key_F); m_findFileAction->setIcon(QIcon::fromTheme("edit-find")); connect(m_findFileAction, &QAction::triggered, this, &DolphinPart::slotFindFile); @@ -232,7 +230,7 @@ void DolphinPart::createActions() m_openTerminalAction->setIcon(QIcon::fromTheme("utilities-terminal")); m_openTerminalAction->setText(i18nc("@action:inmenu Tools", "Open &Terminal")); connect(m_openTerminalAction, &QAction::triggered, this, &DolphinPart::slotOpenTerminal); - m_openTerminalAction->setShortcut(Qt::Key_F4); + actionCollection()->setDefaultShortcut(m_openTerminalAction, Qt::Key_F4); } } @@ -430,7 +428,7 @@ void DolphinPart::slotOpenContextMenu(const QPoint& pos, const bool supportsMoving = capabilities.supportsMoving(); if (capabilities.supportsDeleting()) { - const bool showDeleteAction = (KGlobal::config()->group("KDE").readEntry("ShowDeleteCommand", false) || + const bool showDeleteAction = (KSharedConfig::openConfig()->group("KDE").readEntry("ShowDeleteCommand", false) || !item.isLocalFile()); const bool showMoveToTrashAction = capabilities.isLocal() && supportsMoving;