]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinpart.cpp
operator+/- is disabled for QFlags in qt6
[dolphin.git] / src / dolphinpart.cpp
index 7aaefa6a018ec3032afb9bd124201cc492c849e4..00c99efd0c0805e4567fdf8d506a57b239cb6682 100644 (file)
@@ -17,7 +17,7 @@
 #include "views/dolphinview.h"
 #include "views/dolphinviewactionhandler.h"
 
-#include <KAboutData>
+#include <KPluginMetaData>
 #include <KActionCollection>
 #include <KAuthorized>
 #include <KConfigGroup>
 
 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();