mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-24 12:46:35 +01:00
PluginProxy: Remove QZ_REGISTER_* macros
This commit is contained in:
parent
43fa19121a
commit
977b45505c
@ -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
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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*)));
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "pluginproxy.h"
|
||||
#include "browserwindow.h"
|
||||
#include "../config.h"
|
||||
#include "mainapplication.h"
|
||||
|
||||
#include <QTranslator>
|
||||
|
||||
|
@ -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));
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user