diff options
Diffstat (limited to 'src/dolphinpart.cpp')
| -rw-r--r-- | src/dolphinpart.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index 75784b522..00c99efd0 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -17,7 +17,7 @@ #include "views/dolphinview.h" #include "views/dolphinviewactionhandler.h" -#include <KAboutData> +#include <KPluginMetaData> #include <KActionCollection> #include <KAuthorized> #include <KConfigGroup> @@ -45,15 +45,17 @@ #include <QStandardPaths> #include <QTextDocument> -K_PLUGIN_FACTORY(DolphinPartFactory, registerPlugin<DolphinPart>();) +K_PLUGIN_CLASS_WITH_JSON(DolphinPart, "dolphinpart.json") -DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantList& args) +DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, + const KPluginMetaData& metaData, const QVariantList& args) : KParts::ReadOnlyPart(parent) ,m_openTerminalAction(nullptr) ,m_removeAction(nullptr) { Q_UNUSED(args) - setComponentData(*createAboutData(), false); + setMetaData(metaData); + m_extension = new DolphinPartBrowserExtension(this); // make sure that other apps using this part find Dolphin's view-file-columns icons @@ -141,7 +143,7 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL // TODO there was a "always open a new window" (when clicking on a directory) setting in konqueror // (sort of spacial navigation) - loadPlugins(this, this, componentData()); + loadPlugins(this, this, componentName()); } DolphinPart::~DolphinPart() @@ -163,7 +165,7 @@ void DolphinPart::createActions() QAction* selectItemsMatching = actionCollection()->addAction(QStringLiteral("select_items_matching")); selectItemsMatching->setText(i18nc("@action:inmenu Edit", "Select Items Matching...")); - actionCollection()->setDefaultShortcut(selectItemsMatching, Qt::CTRL + Qt::Key_S); + actionCollection()->setDefaultShortcut(selectItemsMatching, Qt::CTRL | Qt::Key_S); connect(selectItemsMatching, &QAction::triggered, this, &DolphinPart::slotSelectItemsMatchingPattern); QAction* unselectItemsMatching = actionCollection()->addAction(QStringLiteral("unselect_items_matching")); @@ -178,7 +180,7 @@ void DolphinPart::createActions() QAction* invertSelection = actionCollection()->addAction(QStringLiteral("invert_selection")); invertSelection->setText(i18nc("@action:inmenu Edit", "Invert Selection")); - actionCollection()->setDefaultShortcut(invertSelection, 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 @@ -281,11 +283,6 @@ void DolphinPart::updatePasteAction() Q_EMIT m_extension->setActionText( "paste", pasteInfo.second ); } -KAboutData* DolphinPart::createAboutData() -{ - return new KAboutData(QStringLiteral("dolphinpart"), i18nc("@title", "Dolphin Part"), QStringLiteral("0.1")); -} - bool DolphinPart::openUrl(const QUrl &url) { bool reload = arguments().reload(); |
