#include "views/dolphinview.h"
#include "views/dolphinviewactionhandler.h"
-#include <KAboutData>
+#include <KPluginMetaData>
#include <KActionCollection>
#include <KAuthorized>
#include <KConfigGroup>
#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
// 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()
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"));
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
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();