Commit 9b7739ac authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Port KPart plugins to custom KonqParts::Plugin

Existing plugins can still load their plugins using the class provided from KParts.
Plugins that don't use the about to be deprecated KParts::Plugin class should be part of konqueror or
should build against LibKonq.

Task: https://phabricator.kde.org/T12265
parent df0cfd1c
Pipeline #108847 passed with stage
in 3 minutes and 48 seconds
......@@ -55,6 +55,7 @@ install(FILES
konq_historyentry.h
konq_historyprovider.h
konq_popupmenu.h
konq_kpart_plugin.h
${LibKonq_BINARY_DIR}/src/libkonq_export.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}
......
......@@ -22,9 +22,10 @@
#include <QFileInfo>
#include <QStandardPaths>
using namespace KParts;
namespace KonqParts
{
class KParts::PluginPrivate
class PluginPrivate
{
public:
QString m_parentInstance;
......@@ -35,7 +36,6 @@ Plugin::Plugin(QObject *parent)
: QObject(parent)
, d(new PluginPrivate())
{
// qDebug() << className();
}
Plugin::~Plugin() = default;
......@@ -157,9 +157,9 @@ Plugin *Plugin::loadPlugin(QObject *parent, const QString &libname, const QStrin
return plugin;
}
QList<KParts::Plugin *> Plugin::pluginObjects(QObject *parent)
QList<KonqParts::Plugin *> Plugin::pluginObjects(QObject *parent)
{
QList<KParts::Plugin *> objects;
QList<KonqParts::Plugin *> objects;
if (!parent) {
return objects;
......@@ -272,4 +272,5 @@ void Plugin::loadPlugins(QObject *parent,
}
}
}
}
......@@ -17,7 +17,7 @@
class KPluginMetaData;
namespace KParts
namespace KonqParts
{
class PluginPrivate;
......
......@@ -18,7 +18,7 @@ set(akregatorkonqfeedicon_PART_SRCS konqfeedicon.cpp feeddetector.cpp pluginutil
add_library(akregatorkonqfeedicon MODULE ${akregatorkonqfeedicon_PART_SRCS} ${akregatorplugin_DEBUG_SRCS})
target_compile_definitions(akregatorkonqfeedicon PRIVATE TRANSLATION_DOMAIN="akregator_konqplugin")
target_link_libraries(akregatorkonqfeedicon KF5::I18n KF5::Parts KF5::IconThemes)
target_link_libraries(akregatorkonqfeedicon KF5::I18n KF5::IconThemes KF5Konq)
install(TARGETS akregatorkonqfeedicon DESTINATION ${KDE_INSTALL_PLUGINDIR} )
......
......@@ -42,7 +42,7 @@ static QUrl baseUrl(KParts::ReadOnlyPart *part)
}
KonqFeedIcon::KonqFeedIcon(QObject *parent, const QVariantList &args)
: KParts::Plugin(parent),
: KonqParts::Plugin(parent),
m_part(nullptr),
m_feedIcon(nullptr),
m_statusBarEx(nullptr),
......
......@@ -10,7 +10,7 @@
#define KONQFEEDICON_H
#include <qpointer.h>
#include <kparts/plugin.h>
#include <konq_kpart_plugin.h>
#include <QMenu>
#include "feeddetector.h"
......@@ -27,7 +27,7 @@ class ReadOnlyPart;
namespace Akregator
{
class KonqFeedIcon : public KParts::Plugin
class KonqFeedIcon : public KonqParts::Plugin
{
Q_OBJECT
......
......@@ -11,7 +11,7 @@ add_library(autorefresh MODULE ${autorefresh_PART_SRCS})
target_link_libraries(autorefresh KF5::I18n KF5::Parts KF5::IconThemes )
target_link_libraries(autorefresh KF5::I18n KF5::Parts KF5::IconThemes KF5Konq)
install(TARGETS autorefresh DESTINATION ${KDE_INSTALL_PLUGINDIR} )
......
......@@ -19,7 +19,7 @@
#include <KParts/ReadOnlyPart>
AutoRefresh::AutoRefresh(QObject *parent, const QVariantList & /*args*/)
: Plugin(parent)
: KonqParts::Plugin(parent)
{
timer = new QTimer(this);
connect(timer, &QTimer::timeout, this, &AutoRefresh::slotRefresh);
......
......@@ -10,7 +10,7 @@
#define __plugin_autorefresh_h
#include <QVariant>
#include <kparts/plugin.h>
#include <konq_kpart_plugin.h>
class QTimer;
class KSelectAction;
......@@ -29,7 +29,7 @@ class KSelectAction;
* "data" (KDEDIR/share/apps usually)+"/instancename/kpartplugins/"
* where instancename is the name of the part's instance.
**/
class AutoRefresh : public KParts::Plugin
class AutoRefresh : public KonqParts::Plugin
{
Q_OBJECT
public:
......
......@@ -6,7 +6,7 @@ set(babelfishplugin_PART_SRCS plugin_babelfish.cpp )
add_library(babelfishplugin MODULE ${babelfishplugin_PART_SRCS})
target_link_libraries(babelfishplugin KF5::I18n KF5::Parts)
target_link_libraries(babelfishplugin KF5::I18n KF5::Parts KF5Konq)
install(TARGETS babelfishplugin DESTINATION ${KDE_INSTALL_PLUGINDIR} )
......
......@@ -37,7 +37,7 @@ K_PLUGIN_FACTORY(BabelFishFactory, registerPlugin<PluginBabelFish>();)
PluginBabelFish::PluginBabelFish(QObject *parent,
const QVariantList &)
: Plugin(parent),
: KonqParts::Plugin(parent),
m_actionGroup(this)
{
m_menu = new KActionMenu(QIcon::fromTheme(QStringLiteral("babelfish")), i18n("Translate Web &Page"),
......
......@@ -7,11 +7,11 @@
#ifndef __plugin_babelfish_h
#define __plugin_babelfish_h
#include <kparts/plugin.h>
#include <konq_kpart_plugin.h>
#include <kactionmenu.h>
#include <QActionGroup>
class PluginBabelFish : public KParts::Plugin
class PluginBabelFish : public KonqParts::Plugin
{
Q_OBJECT
public:
......
......@@ -4,7 +4,7 @@ set(dirfilterplugin_PART_SRCS dirfilterplugin.cpp )
add_library(dirfilterplugin MODULE ${dirfilterplugin_PART_SRCS})
target_link_libraries(dirfilterplugin KF5::I18n KF5::Parts)
target_link_libraries(dirfilterplugin KF5::I18n KF5::Parts KF5Konq)
install(TARGETS dirfilterplugin DESTINATION ${KDE_INSTALL_PLUGINDIR} )
......
......@@ -207,7 +207,7 @@ void FilterBar::keyReleaseEvent(QKeyEvent *event)
}
DirFilterPlugin::DirFilterPlugin(QObject *parent, const QVariantList &)
: KParts::Plugin(parent)
: KonqParts::Plugin(parent)
, m_filterBar(nullptr)
, m_focusWidget(nullptr)
{
......
......@@ -14,7 +14,7 @@
#include <QMenu>
#include <QUrl>
#include <kparts/plugin.h>
#include <konq_kpart_plugin.h>
#include <KParts/ListingFilterExtension>
#include <KParts/ListingNotificationExtension>
......@@ -84,7 +84,7 @@ private:
QMap<QString, Filters> m_filters;
};
class DirFilterPlugin : public KParts::Plugin
class DirFilterPlugin : public KonqParts::Plugin
{
Q_OBJECT
......
......@@ -15,7 +15,7 @@ add_library(khtmlsettingsplugin MODULE ${khtmlsettingsplugin_PART_SRCS})
kcoreaddons_desktop_to_json(khtmlsettingsplugin ${CMAKE_CURRENT_BINARY_DIR}/khtmlsettingsplugin.desktop)
target_link_libraries(khtmlsettingsplugin KF5::I18n KF5::Parts)
target_link_libraries(khtmlsettingsplugin KF5::I18n KF5::Parts KF5Konq)
install(TARGETS khtmlsettingsplugin DESTINATION ${KDE_INSTALL_PLUGINDIR} )
......
......@@ -41,7 +41,7 @@ SettingsPlugin::SettingsPlugin(QObject *parent,
const KPluginMetaData& metaData,
#endif
const QVariantList &)
: KParts::Plugin(parent), mConfig(nullptr)
: KonqParts::Plugin(parent), mConfig(nullptr)
{
#if KPARTS_VERSION >= QT_VERSION_CHECK(5, 77, 0)
setMetaData(metaData);
......
......@@ -8,11 +8,11 @@
#define SETTINGS_PLUGIN
#include <kparts_version.h>
#include <kparts/plugin.h>
#include <konq_kpart_plugin.h>
class KConfig;
class SettingsPlugin : public KParts::Plugin
class SettingsPlugin : public KonqParts::Plugin
{
Q_OBJECT
public:
......
......@@ -6,7 +6,7 @@ ecm_qt_declare_logging_category(kimgallery_PART_SRCS HEADER imgallery_debug.h ID
add_library(kimgallery MODULE ${kimgallery_PART_SRCS})
target_link_libraries(kimgallery KF5::I18n KF5::WidgetsAddons KF5::KIOWidgets KF5::Parts)
target_link_libraries(kimgallery KF5::I18n KF5::WidgetsAddons KF5::KIOWidgets KF5::Parts KF5Konq)
install(TARGETS kimgallery DESTINATION ${KDE_INSTALL_PLUGINDIR} )
......
......@@ -46,7 +46,7 @@ static QString directory(const QUrl &url) {
}
KImGalleryPlugin::KImGalleryPlugin(QObject *parent, const QVariantList &)
: KParts::Plugin(parent), m_commentMap(nullptr)
: KonqParts::Plugin(parent), m_commentMap(nullptr)
{
QAction *a = actionCollection()->addAction(QStringLiteral("create_img_gallery"));
a->setText(i18n("&Create Image Gallery..."));
......
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