diff --git a/src/lib/plugins/plugininterface.h b/src/lib/plugins/plugininterface.h index bae2d05c1..c4f49031b 100644 --- a/src/lib/plugins/plugininterface.h +++ b/src/lib/plugins/plugininterface.h @@ -18,14 +18,12 @@ #ifndef PLUGININTERFACE_H #define PLUGININTERFACE_H -#include #include #include #include "qzcommon.h" #include "webhittestresult.h" -class QTranslator; class QMenu; class QMouseEvent; class QKeyEvent; @@ -38,15 +36,18 @@ class DesktopFile; class PluginInterface { public: - enum InitState { StartupInitState, LateInitState }; + enum InitState { + StartupInitState, + LateInitState + }; + + virtual ~PluginInterface() { } virtual DesktopFile metaData() const = 0; virtual void init(InitState state, const QString &settingsPath) = 0; virtual void unload() = 0; virtual bool testPlugin() = 0; - virtual ~PluginInterface() { } - virtual QTranslator* getTranslator(const QString &locale) { Q_UNUSED(locale) return 0; } virtual void showSettings(QWidget* parent = 0) { Q_UNUSED(parent) } virtual void populateWebViewMenu(QMenu* menu, WebView* view, const WebHitTestResult &r) { Q_UNUSED(menu) Q_UNUSED(view) Q_UNUSED(r) } @@ -65,6 +66,6 @@ public: virtual bool acceptNavigationRequest(WebPage *page, const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame) { Q_UNUSED(page); Q_UNUSED(url); Q_UNUSED(type); Q_UNUSED(isMainFrame); return true; } }; -Q_DECLARE_INTERFACE(PluginInterface, "Falkon.Browser.PluginInterface/2.2") +Q_DECLARE_INTERFACE(PluginInterface, "Falkon.Browser.PluginInterface/2.3") #endif // PLUGININTERFACE_H diff --git a/src/plugins/AutoScroll/autoscrollplugin.cpp b/src/plugins/AutoScroll/autoscrollplugin.cpp index b9e3cf639..19366605f 100644 --- a/src/plugins/AutoScroll/autoscrollplugin.cpp +++ b/src/plugins/AutoScroll/autoscrollplugin.cpp @@ -24,8 +24,6 @@ #include "../config.h" #include "desktopfile.h" -#include - AutoScrollPlugin::AutoScrollPlugin() : QObject() , m_scroller(0) @@ -60,13 +58,6 @@ bool AutoScrollPlugin::testPlugin() return (Qz::VERSION == QLatin1String(FALKON_VERSION)); } -QTranslator* AutoScrollPlugin::getTranslator(const QString &locale) -{ - QTranslator* translator = new QTranslator(this); - translator->load(locale, ":/autoscroll/locale/"); - return translator; -} - void AutoScrollPlugin::showSettings(QWidget* parent) { if (!m_settings) { diff --git a/src/plugins/AutoScroll/autoscrollplugin.h b/src/plugins/AutoScroll/autoscrollplugin.h index 4356ec59d..ba9cdb200 100644 --- a/src/plugins/AutoScroll/autoscrollplugin.h +++ b/src/plugins/AutoScroll/autoscrollplugin.h @@ -36,7 +36,6 @@ public: void init(InitState state, const QString &settingsPath) override; void unload() override; bool testPlugin() override; - QTranslator *getTranslator(const QString &locale) override; void showSettings(QWidget *parent) override; bool mouseMove(Qz::ObjectName type, QObject *obj, QMouseEvent *event) override; diff --git a/src/plugins/FlashCookieManager/fcm_plugin.cpp b/src/plugins/FlashCookieManager/fcm_plugin.cpp index d564055c3..e262430a6 100644 --- a/src/plugins/FlashCookieManager/fcm_plugin.cpp +++ b/src/plugins/FlashCookieManager/fcm_plugin.cpp @@ -32,7 +32,6 @@ #include #include -#include #include #include @@ -120,13 +119,6 @@ bool FCM_Plugin::testPlugin() return (Qz::VERSION == QLatin1String(FALKON_VERSION)); } -QTranslator* FCM_Plugin::getTranslator(const QString &locale) -{ - QTranslator* translator = new QTranslator(this); - translator->load(locale, ":/flashcookiemanager/locale/"); - return translator; -} - void FCM_Plugin::showSettings(QWidget* parent) { Q_UNUSED(parent) diff --git a/src/plugins/FlashCookieManager/fcm_plugin.h b/src/plugins/FlashCookieManager/fcm_plugin.h index 78c606f3d..ef84a1720 100644 --- a/src/plugins/FlashCookieManager/fcm_plugin.h +++ b/src/plugins/FlashCookieManager/fcm_plugin.h @@ -55,7 +55,6 @@ public: void init(InitState state, const QString &settingsPath) override; void unload() override; bool testPlugin() override; - QTranslator *getTranslator(const QString &locale) override; void showSettings(QWidget *parent) override; void populateExtensionsMenu(QMenu *menu) override; diff --git a/src/plugins/GnomeKeyringPasswords/gnomekeyringplugin.cpp b/src/plugins/GnomeKeyringPasswords/gnomekeyringplugin.cpp index 3a4005387..671b48ffa 100644 --- a/src/plugins/GnomeKeyringPasswords/gnomekeyringplugin.cpp +++ b/src/plugins/GnomeKeyringPasswords/gnomekeyringplugin.cpp @@ -25,8 +25,6 @@ #include "passwordmanager.h" #include "desktopfile.h" -#include - GnomeKeyringPlugin::GnomeKeyringPlugin() : QObject() , m_backend(0) @@ -58,10 +56,3 @@ bool GnomeKeyringPlugin::testPlugin() // Require the version that the plugin was built with return (Qz::VERSION == QLatin1String(FALKON_VERSION)); } - -QTranslator* GnomeKeyringPlugin::getTranslator(const QString &locale) -{ - QTranslator* translator = new QTranslator(this); - translator->load(locale, ":/gkp/locale/"); - return translator; -} diff --git a/src/plugins/GnomeKeyringPasswords/gnomekeyringplugin.h b/src/plugins/GnomeKeyringPasswords/gnomekeyringplugin.h index 436e83fd4..c8c3486b7 100644 --- a/src/plugins/GnomeKeyringPasswords/gnomekeyringplugin.h +++ b/src/plugins/GnomeKeyringPasswords/gnomekeyringplugin.h @@ -37,8 +37,6 @@ public: void unload(); bool testPlugin(); - QTranslator* getTranslator(const QString &locale); - private: GnomeKeyringPasswordBackend* m_backend; diff --git a/src/plugins/GreaseMonkey/gm_plugin.cpp b/src/plugins/GreaseMonkey/gm_plugin.cpp index 5c684a3f5..9364903ab 100644 --- a/src/plugins/GreaseMonkey/gm_plugin.cpp +++ b/src/plugins/GreaseMonkey/gm_plugin.cpp @@ -27,8 +27,6 @@ #include "../config.h" #include "desktopfile.h" -#include - GM_Plugin::GM_Plugin() : QObject() , m_manager(0) @@ -67,13 +65,6 @@ bool GM_Plugin::testPlugin() return (Qz::VERSION == QLatin1String(FALKON_VERSION)); } -QTranslator* GM_Plugin::getTranslator(const QString &locale) -{ - QTranslator* translator = new QTranslator(this); - translator->load(locale, ":/gm/locale/"); - return translator; -} - void GM_Plugin::showSettings(QWidget* parent) { m_manager->showSettings(parent); diff --git a/src/plugins/GreaseMonkey/gm_plugin.h b/src/plugins/GreaseMonkey/gm_plugin.h index 70c411be7..5c0c12378 100644 --- a/src/plugins/GreaseMonkey/gm_plugin.h +++ b/src/plugins/GreaseMonkey/gm_plugin.h @@ -35,7 +35,6 @@ public: void init(InitState state, const QString &settingsPath) override; void unload() override; bool testPlugin() override; - QTranslator* getTranslator(const QString &locale) override; void showSettings(QWidget* parent = 0) override; bool acceptNavigationRequest(WebPage *page, const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame) override; diff --git a/src/plugins/ImageFinder/imagefinderplugin.cpp b/src/plugins/ImageFinder/imagefinderplugin.cpp index 6f143a019..4b846ce13 100644 --- a/src/plugins/ImageFinder/imagefinderplugin.cpp +++ b/src/plugins/ImageFinder/imagefinderplugin.cpp @@ -27,7 +27,6 @@ #include "desktopfile.h" #include -#include ImageFinderPlugin::ImageFinderPlugin() : QObject() @@ -58,13 +57,6 @@ bool ImageFinderPlugin::testPlugin() return (Qz::VERSION == QLatin1String(FALKON_VERSION)); } -QTranslator *ImageFinderPlugin::getTranslator(const QString &locale) -{ - QTranslator *translator = new QTranslator(this); - translator->load(locale, QSL(":/imgfinder/locale/")); - return translator; -} - void ImageFinderPlugin::showSettings(QWidget *parent) { if (!m_settings) { diff --git a/src/plugins/ImageFinder/imagefinderplugin.h b/src/plugins/ImageFinder/imagefinderplugin.h index b20c499d1..189e1eec6 100644 --- a/src/plugins/ImageFinder/imagefinderplugin.h +++ b/src/plugins/ImageFinder/imagefinderplugin.h @@ -37,7 +37,6 @@ public: void init(InitState state, const QString &settingsPath) override; void unload() override; bool testPlugin() override; - QTranslator *getTranslator(const QString &locale) override; void showSettings(QWidget *parent) override; void populateWebViewMenu(QMenu *menu, WebView *view, const WebHitTestResult &r) override; diff --git a/src/plugins/KWalletPasswords/kwalletplugin.cpp b/src/plugins/KWalletPasswords/kwalletplugin.cpp index 61da76cff..cc37ff882 100644 --- a/src/plugins/KWalletPasswords/kwalletplugin.cpp +++ b/src/plugins/KWalletPasswords/kwalletplugin.cpp @@ -25,8 +25,6 @@ #include "passwordmanager.h" #include "desktopfile.h" -#include - KWalletPlugin::KWalletPlugin() : QObject() , m_backend(0) @@ -58,10 +56,3 @@ bool KWalletPlugin::testPlugin() // Require the version that the plugin was built with return (Qz::VERSION == QLatin1String(FALKON_VERSION)); } - -QTranslator* KWalletPlugin::getTranslator(const QString &locale) -{ - QTranslator* translator = new QTranslator(this); - translator->load(locale, ":/kwp/locale/"); - return translator; -} diff --git a/src/plugins/KWalletPasswords/kwalletplugin.h b/src/plugins/KWalletPasswords/kwalletplugin.h index 75f1080cf..e358623e5 100644 --- a/src/plugins/KWalletPasswords/kwalletplugin.h +++ b/src/plugins/KWalletPasswords/kwalletplugin.h @@ -35,7 +35,6 @@ public: void init(InitState state, const QString &settingsPath) override; void unload() override; bool testPlugin() override; - QTranslator *getTranslator(const QString &locale) override; private: KWalletPasswordBackend* m_backend; diff --git a/src/plugins/MouseGestures/mousegesturesplugin.cpp b/src/plugins/MouseGestures/mousegesturesplugin.cpp index 51fbfbcca..22e4c9599 100644 --- a/src/plugins/MouseGestures/mousegesturesplugin.cpp +++ b/src/plugins/MouseGestures/mousegesturesplugin.cpp @@ -23,8 +23,6 @@ #include "../config.h" #include "desktopfile.h" -#include - MouseGesturesPlugin::MouseGesturesPlugin() : QObject() , m_gestures(0) @@ -59,13 +57,6 @@ bool MouseGesturesPlugin::testPlugin() return (Qz::VERSION == QLatin1String(FALKON_VERSION)); } -QTranslator* MouseGesturesPlugin::getTranslator(const QString &locale) -{ - QTranslator* translator = new QTranslator(this); - translator->load(locale, ":/mousegestures/locale/"); - return translator; -} - void MouseGesturesPlugin::showSettings(QWidget* parent) { m_gestures->showSettings(parent); diff --git a/src/plugins/MouseGestures/mousegesturesplugin.h b/src/plugins/MouseGestures/mousegesturesplugin.h index 77d91856f..dfaf96099 100644 --- a/src/plugins/MouseGestures/mousegesturesplugin.h +++ b/src/plugins/MouseGestures/mousegesturesplugin.h @@ -34,7 +34,6 @@ public: void init(InitState state, const QString &settingsPath) override; void unload() override; bool testPlugin() override; - QTranslator *getTranslator(const QString &locale) override; void showSettings(QWidget *parent) override; bool mousePress(Qz::ObjectName type, QObject *obj, QMouseEvent *event) override; diff --git a/src/plugins/PIM/PIM_plugin.cpp b/src/plugins/PIM/PIM_plugin.cpp index 1d8e11b14..dbef22778 100644 --- a/src/plugins/PIM/PIM_plugin.cpp +++ b/src/plugins/PIM/PIM_plugin.cpp @@ -26,8 +26,6 @@ #include "../config.h" #include "desktopfile.h" -#include - PIM_Plugin::PIM_Plugin() : QObject() , m_handler(0) @@ -62,13 +60,6 @@ bool PIM_Plugin::testPlugin() return (Qz::VERSION == QLatin1String(FALKON_VERSION)); } -QTranslator* PIM_Plugin::getTranslator(const QString &locale) -{ - QTranslator* translator = new QTranslator(this); - translator->load(locale, ":/PIM/locale/"); - return translator; -} - void PIM_Plugin::showSettings(QWidget* parent) { m_handler->showSettings(parent); diff --git a/src/plugins/PIM/PIM_plugin.h b/src/plugins/PIM/PIM_plugin.h index 347047fe4..757b2f3b0 100644 --- a/src/plugins/PIM/PIM_plugin.h +++ b/src/plugins/PIM/PIM_plugin.h @@ -38,7 +38,6 @@ public: void init(InitState state, const QString &settingsPath) override; void unload() override; bool testPlugin() override; - QTranslator *getTranslator(const QString &locale) override; void showSettings(QWidget *parent) override; void populateWebViewMenu(QMenu *menu, WebView *view, const WebHitTestResult &r) override; diff --git a/src/plugins/StatusBarIcons/statusbariconsplugin.cpp b/src/plugins/StatusBarIcons/statusbariconsplugin.cpp index 594641155..4d054cd5f 100644 --- a/src/plugins/StatusBarIcons/statusbariconsplugin.cpp +++ b/src/plugins/StatusBarIcons/statusbariconsplugin.cpp @@ -24,8 +24,6 @@ #include "mainapplication.h" #include "desktopfile.h" -#include - StatusBarIconsPlugin::StatusBarIconsPlugin() : QObject() , m_manager(0) @@ -70,13 +68,6 @@ bool StatusBarIconsPlugin::testPlugin() return (Qz::VERSION == QLatin1String(FALKON_VERSION)); } -QTranslator* StatusBarIconsPlugin::getTranslator(const QString &locale) -{ - QTranslator* translator = new QTranslator(this); - translator->load(locale, ":/sbi/locale/"); - return translator; -} - void StatusBarIconsPlugin::showSettings(QWidget* parent) { SBI_SettingsDialog* dialog = new SBI_SettingsDialog(m_manager, parent); diff --git a/src/plugins/StatusBarIcons/statusbariconsplugin.h b/src/plugins/StatusBarIcons/statusbariconsplugin.h index 641e55074..b251536da 100644 --- a/src/plugins/StatusBarIcons/statusbariconsplugin.h +++ b/src/plugins/StatusBarIcons/statusbariconsplugin.h @@ -35,7 +35,6 @@ public: void init(InitState state, const QString &settingsPath) override; void unload() override; bool testPlugin() override; - QTranslator *getTranslator(const QString &locale) override; void showSettings(QWidget *parent) override; private: diff --git a/src/plugins/TabManager/tabmanagerplugin.cpp b/src/plugins/TabManager/tabmanagerplugin.cpp index 8b0684ed8..35fc63790 100644 --- a/src/plugins/TabManager/tabmanagerplugin.cpp +++ b/src/plugins/TabManager/tabmanagerplugin.cpp @@ -29,7 +29,6 @@ #include "desktopfile.h" #include -#include #include #include #include @@ -92,13 +91,6 @@ bool TabManagerPlugin::testPlugin() return (Qz::VERSION == QLatin1String(FALKON_VERSION)); } -QTranslator* TabManagerPlugin::getTranslator(const QString &locale) -{ - QTranslator* translator = new QTranslator(this); - translator->load(locale, ":/tabmanager/locale/"); - return translator; -} - void TabManagerPlugin::showSettings(QWidget* parent) { TabManagerSettings* settings = new TabManagerSettings(this, parent); diff --git a/src/plugins/TabManager/tabmanagerplugin.h b/src/plugins/TabManager/tabmanagerplugin.h index 3ff6f4aa8..f7682019a 100644 --- a/src/plugins/TabManager/tabmanagerplugin.h +++ b/src/plugins/TabManager/tabmanagerplugin.h @@ -43,7 +43,6 @@ public: void init(InitState state, const QString &settingsPath) override; void unload() override; bool testPlugin() override; - QTranslator *getTranslator(const QString &locale) override; void showSettings(QWidget *parent) override; void populateExtensionsMenu(QMenu *menu) override; diff --git a/src/plugins/TestPlugin/testplugin.cpp b/src/plugins/TestPlugin/testplugin.cpp index 1272b5c7b..5a475e0e5 100644 --- a/src/plugins/TestPlugin/testplugin.cpp +++ b/src/plugins/TestPlugin/testplugin.cpp @@ -27,7 +27,6 @@ #include "desktopfile.h" #include -#include #include TestPlugin::TestPlugin() @@ -96,16 +95,6 @@ bool TestPlugin::testPlugin() return (Qz::VERSION == QLatin1String(FALKON_VERSION)); } -QTranslator* TestPlugin::getTranslator(const QString &locale) -{ - // Loads translation according to locale file - // QString locale will contains "fr_FR.qm" for French locale - - QTranslator* translator = new QTranslator(this); - translator->load(locale, ":/testplugin/locale/"); - return translator; -} - void TestPlugin::showSettings(QWidget* parent) { // This function will be called from Preferences after clicking on Settings button. diff --git a/src/plugins/TestPlugin/testplugin.h b/src/plugins/TestPlugin/testplugin.h index 290f5337c..c4b6eec75 100644 --- a/src/plugins/TestPlugin/testplugin.h +++ b/src/plugins/TestPlugin/testplugin.h @@ -41,7 +41,6 @@ public: void init(InitState state, const QString &settingsPath) override; void unload() override; bool testPlugin() override; - QTranslator *getTranslator(const QString &locale) override; void showSettings(QWidget *parent) override; void populateWebViewMenu(QMenu *menu, WebView *view, const WebHitTestResult &r) override; diff --git a/src/plugins/VerticalTabs/verticaltabsplugin.cpp b/src/plugins/VerticalTabs/verticaltabsplugin.cpp index 964dd5cee..5c271618e 100644 --- a/src/plugins/VerticalTabs/verticaltabsplugin.cpp +++ b/src/plugins/VerticalTabs/verticaltabsplugin.cpp @@ -31,7 +31,6 @@ #include "desktopfile.h" #include -#include VerticalTabsPlugin::VerticalTabsPlugin() : QObject() @@ -92,13 +91,6 @@ bool VerticalTabsPlugin::testPlugin() return (Qz::VERSION == QSL(FALKON_VERSION)); } -QTranslator *VerticalTabsPlugin::getTranslator(const QString &locale) -{ - QTranslator *translator = new QTranslator(this); - translator->load(locale, QSL(":/verticaltabs/locale/")); - return translator; -} - void VerticalTabsPlugin::showSettings(QWidget *parent) { VerticalTabsSettings *settings = new VerticalTabsSettings(this, parent); diff --git a/src/plugins/VerticalTabs/verticaltabsplugin.h b/src/plugins/VerticalTabs/verticaltabsplugin.h index d4d2a814d..995ca38ba 100644 --- a/src/plugins/VerticalTabs/verticaltabsplugin.h +++ b/src/plugins/VerticalTabs/verticaltabsplugin.h @@ -37,7 +37,6 @@ public: void init(InitState state, const QString &settingsPath) override; void unload() override; bool testPlugin() override; - QTranslator* getTranslator(const QString &locale) override; void showSettings(QWidget *parent = nullptr) override; bool keyPress(Qz::ObjectName type, QObject *obj, QKeyEvent *event) override;