mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
[Qt5] Ported all plugins to Qt5 plugin system
This commit is contained in:
parent
51f1c73d20
commit
7e6802ba35
|
@ -17,7 +17,4 @@ TEMPLATE = subdirs
|
||||||
SUBDIRS = src/lib src/main
|
SUBDIRS = src/lib src/main
|
||||||
CONFIG += ordered
|
CONFIG += ordered
|
||||||
|
|
||||||
# TODO: Fix plugins for Qt5
|
|
||||||
!isEqual(QT_MAJOR_VERSION, 5) {
|
|
||||||
SUBDIRS += src/plugins
|
SUBDIRS += src/plugins
|
||||||
}
|
|
||||||
|
|
|
@ -91,4 +91,6 @@ bool AKN_Plugin::keyPress(const Qz::ObjectName &type, QObject* obj, QKeyEvent* e
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_VERSION < 0x050000
|
||||||
Q_EXPORT_PLUGIN2(AccessKeysNavigation, AKN_Plugin)
|
Q_EXPORT_PLUGIN2(AccessKeysNavigation, AKN_Plugin)
|
||||||
|
#endif
|
||||||
|
|
|
@ -30,6 +30,10 @@ class AKN_Plugin : public QObject, public PluginInterface
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_INTERFACES(PluginInterface)
|
Q_INTERFACES(PluginInterface)
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.AKN")
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AKN_Plugin();
|
AKN_Plugin();
|
||||||
PluginSpec pluginSpec();
|
PluginSpec pluginSpec();
|
||||||
|
|
|
@ -98,4 +98,6 @@ void GM_Plugin::webPageCreated(WebPage* page)
|
||||||
connect(page->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), m_manager, SLOT(pageLoadStart()));
|
connect(page->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), m_manager, SLOT(pageLoadStart()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_VERSION < 0x050000
|
||||||
Q_EXPORT_PLUGIN2(GreaseMonkey, GM_Plugin)
|
Q_EXPORT_PLUGIN2(GreaseMonkey, GM_Plugin)
|
||||||
|
#endif
|
||||||
|
|
|
@ -28,6 +28,10 @@ class GM_Plugin : public QObject, public PluginInterface
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_INTERFACES(PluginInterface)
|
Q_INTERFACES(PluginInterface)
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.GreaseMonkey")
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit GM_Plugin();
|
explicit GM_Plugin();
|
||||||
PluginSpec pluginSpec();
|
PluginSpec pluginSpec();
|
||||||
|
|
|
@ -106,4 +106,6 @@ bool MouseGesturesPlugin::mouseMove(const Qz::ObjectName &type, QObject* obj, QM
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_VERSION < 0x050000
|
||||||
Q_EXPORT_PLUGIN2(MouseGestures, MouseGesturesPlugin)
|
Q_EXPORT_PLUGIN2(MouseGestures, MouseGesturesPlugin)
|
||||||
|
#endif
|
||||||
|
|
|
@ -26,6 +26,10 @@ class MouseGesturesPlugin : public QObject, public PluginInterface
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_INTERFACES(PluginInterface)
|
Q_INTERFACES(PluginInterface)
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.MouseGestures")
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MouseGesturesPlugin();
|
MouseGesturesPlugin();
|
||||||
PluginSpec pluginSpec();
|
PluginSpec pluginSpec();
|
||||||
|
|
|
@ -95,4 +95,6 @@ bool PIM_Plugin::keyPress(const Qz::ObjectName &type, QObject* obj, QKeyEvent* e
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_VERSION < 0x050000
|
||||||
Q_EXPORT_PLUGIN2(PIM, PIM_Plugin)
|
Q_EXPORT_PLUGIN2(PIM, PIM_Plugin)
|
||||||
|
#endif
|
||||||
|
|
|
@ -30,6 +30,10 @@ class PIM_Plugin : public QObject, public PluginInterface
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_INTERFACES(PluginInterface)
|
Q_INTERFACES(PluginInterface)
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.PIM")
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PIM_Plugin();
|
PIM_Plugin();
|
||||||
PluginSpec pluginSpec();
|
PluginSpec pluginSpec();
|
||||||
|
|
|
@ -173,4 +173,7 @@ void TestPlugin::actionSlot()
|
||||||
// Export plugin macro
|
// Export plugin macro
|
||||||
// This macro has to be only in class derived from PluginInterface
|
// This macro has to be only in class derived from PluginInterface
|
||||||
// Don't call it in other files!
|
// Don't call it in other files!
|
||||||
|
|
||||||
|
#if QT_VERSION < 0x050000
|
||||||
Q_EXPORT_PLUGIN2(ExamplePlugin, TestPlugin)
|
Q_EXPORT_PLUGIN2(ExamplePlugin, TestPlugin)
|
||||||
|
#endif
|
||||||
|
|
|
@ -31,13 +31,17 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QWebElement>
|
#include <QWebElement>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QWeakPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
class TestPlugin : public QObject, public PluginInterface
|
class TestPlugin : public QObject, public PluginInterface
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_INTERFACES(PluginInterface)
|
Q_INTERFACES(PluginInterface)
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.TestPlugin")
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TestPlugin();
|
explicit TestPlugin();
|
||||||
PluginSpec pluginSpec();
|
PluginSpec pluginSpec();
|
||||||
|
@ -57,7 +61,7 @@ private slots:
|
||||||
void actionSlot();
|
void actionSlot();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QWeakPointer<QDialog> m_settings;
|
QPointer<QDialog> m_settings;
|
||||||
|
|
||||||
WebView* m_view;
|
WebView* m_view;
|
||||||
QString m_settingsPath;
|
QString m_settingsPath;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user