1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

PluginProxy: Remove QZ_REGISTER_* macros

This commit is contained in:
David Rosca 2018-02-06 15:48:30 +01:00
parent 43fa19121a
commit 977b45505c
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8
10 changed files with 15 additions and 32 deletions

View File

@ -1,6 +1,6 @@
/* ============================================================
* Falkon - Qt web browser
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
* Copyright (C) 2010-2018 David Rosca <nowrep@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -82,22 +82,4 @@ private:
QList<PluginInterface*> m_keyReleaseHandlers;
};
#include "mainapplication.h"
#include "networkmanager.h"
#include "autofill.h"
#include "passwordmanager.h"
#define QZ_REGISTER_EVENT_HANDLER(Type) \
mApp->plugins()->registerAppEventHandler(Type, this);
#define QZ_REGISTER_SCHEME_HANDLER(Scheme, Object) \
mApp->networkManager()->registerSchemeHandler(Scheme, Object);
#define QZ_UNREGISTER_SCHEME_HANDLER(Scheme, Object) \
mApp->networkManager()->unregisterSchemeHandler(Scheme, Object);
#define QZ_REGISTER_PASSWORD_BACKEND(Name, Object) \
mApp->autoFill()->passwordManager()->registerBackend(Name, Object);
#define QZ_UNREGISTER_PASSWORD_BACKEND(Object) \
mApp->autoFill()->passwordManager()->unregisterBackend(Object);
#endif // PLUGINPROXY_H

View File

@ -51,7 +51,7 @@ void AKN_Plugin::init(InitState state, const QString &sPath)
m_handler = new AKN_Handler(sPath, this);
QZ_REGISTER_EVENT_HANDLER(PluginProxy::KeyPressHandler);
mApp->plugins->registerAppEventHandler(PluginProxy::KeyPressHandler, this);
}
void AKN_Plugin::unload()

View File

@ -51,10 +51,10 @@ void AutoScrollPlugin::init(InitState state, const QString &settingsPath)
m_scroller = new AutoScroller(settingsPath + QL1S("/extensions.ini"), this);
QZ_REGISTER_EVENT_HANDLER(PluginProxy::MouseMoveHandler);
QZ_REGISTER_EVENT_HANDLER(PluginProxy::MousePressHandler);
QZ_REGISTER_EVENT_HANDLER(PluginProxy::MouseReleaseHandler);
QZ_REGISTER_EVENT_HANDLER(PluginProxy::WheelEventHandler);
mApp->plugins()->registerAppEventHandler(PluginProxy::MouseMoveHandler, this);
mApp->plugins()->registerAppEventHandler(PluginProxy::MousePressHandler, this);
mApp->plugins()->registerAppEventHandler(PluginProxy::MouseReleaseHandler, this);
mApp->plugins()->registerAppEventHandler(PluginProxy::WheelEventHandler, this);
}
void AutoScrollPlugin::unload()

View File

@ -49,7 +49,7 @@ void GnomeKeyringPlugin::init(InitState state, const QString &settingsPath)
Q_UNUSED(settingsPath);
m_backend = new GnomeKeyringPasswordBackend;
QZ_REGISTER_PASSWORD_BACKEND("GnomeKeyring", m_backend);
mApp->autoFill()->passwordManager()->registerBackend(QSL("GnomeKeyring"), m_backend);
}
void GnomeKeyringPlugin::unload()

View File

@ -49,7 +49,7 @@ void KWalletPlugin::init(InitState state, const QString &settingsPath)
Q_UNUSED(settingsPath);
m_backend = new KWalletPasswordBackend;
QZ_REGISTER_PASSWORD_BACKEND("KWallet", m_backend);
mApp->autoFill()->passwordManager()->registerBackend(QSL("KWallet"), m_backend);
}
void KWalletPlugin::unload()

View File

@ -50,9 +50,9 @@ void MouseGesturesPlugin::init(InitState state, const QString &settingsPath)
m_gestures = new MouseGestures(settingsPath, this);
QZ_REGISTER_EVENT_HANDLER(PluginProxy::MousePressHandler);
QZ_REGISTER_EVENT_HANDLER(PluginProxy::MouseReleaseHandler);
QZ_REGISTER_EVENT_HANDLER(PluginProxy::MouseMoveHandler);
mApp->plugins()->registerAppEventHandler(PluginProxy::MousePressHandler, this);
mApp->plugins()->registerAppEventHandler(PluginProxy::MouseReleaseHandler, this);
mApp->plugins()->registerAppEventHandler(PluginProxy::MouseMoveHandler, this);
}
void MouseGesturesPlugin::unload()

View File

@ -53,7 +53,7 @@ void PIM_Plugin::init(InitState state, const QString &settingsPath)
m_handler = new PIM_Handler(settingsPath, this);
QZ_REGISTER_EVENT_HANDLER(PluginProxy::KeyPressHandler);
mApp->plugins()->registerAppEventHandler(PluginProxy::KeyPressHandler, this);
connect(mApp->plugins(), SIGNAL(webPageCreated(WebPage*)), m_handler, SLOT(webPageCreated(WebPage*)));
}

View File

@ -21,6 +21,7 @@
#include "pluginproxy.h"
#include "browserwindow.h"
#include "../config.h"
#include "mainapplication.h"
#include <QTranslator>

View File

@ -73,7 +73,7 @@ void TestPlugin::init(InitState state, const QString &settingsPath)
// Registering this plugin as a MousePressHandler.
// Otherwise mousePress() function will never be called
QZ_REGISTER_EVENT_HANDLER(PluginProxy::MousePressHandler);
mApp->plugins()->registerAppEventHandler(PluginProxy::MousePressHandler, this);
// Adding new sidebar into application
SideBarManager::addSidebar("testplugin-sidebar", new TestPlugin_Sidebar(this));

View File

@ -65,7 +65,7 @@ void VerticalTabsPlugin::init(InitState state, const QString &settingsPath)
m_controller = new VerticalTabsController(this);
SideBarManager::addSidebar(QSL("VerticalTabs"), m_controller);
QZ_REGISTER_EVENT_HANDLER(PluginProxy::KeyPressHandler);
mApp->plugins()->registerAppEventHandler(PluginProxy::KeyPressHandler, this);
mApp->networkManager()->registerExtensionSchemeHandler(QSL("verticaltabs"), new VerticalTabsSchemeHandler);
setWebTabBehavior(m_addChildBehavior);