From 3932371cd12ae7ec0812fbb2db3315448e18f1a8 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sun, 11 Oct 2020 21:17:34 +0200 Subject: Use proxy for ModList, PluginList and DownloadManager. Do not use registered callbacks when plugin is inactive. --- src/pluginlistproxy.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/pluginlistproxy.h (limited to 'src/pluginlistproxy.h') diff --git a/src/pluginlistproxy.h b/src/pluginlistproxy.h new file mode 100644 index 00000000..e08406e3 --- /dev/null +++ b/src/pluginlistproxy.h @@ -0,0 +1,36 @@ +#ifndef PLUGINLISTPROXY_H +#define PLUGINLISTPROXY_H + +#include + +class OrganizerProxy; + +class PluginListProxy : public MOBase::IPluginList +{ + +public: + + PluginListProxy(OrganizerProxy* oproxy, IPluginList* pluginlist); + virtual ~PluginListProxy() { } + + QStringList pluginNames() const override; + PluginStates state(const QString& name) const override; + void setState(const QString& name, PluginStates state) override; + int priority(const QString& name) const override; + bool setPriority(const QString& name, int newPriority) override; + int loadOrder(const QString& name) const override; + void setLoadOrder(const QStringList& pluginList) override; + bool isMaster(const QString& name) const override; + QStringList masters(const QString& name) const override; + QString origin(const QString& name) const override; + bool onRefreshed(const std::function& callback) override; + bool onPluginMoved(const std::function& func) override; + bool onPluginStateChanged(const std::function&)>& func) override; + +private: + + OrganizerProxy* m_OrganizerProxy; + IPluginList* m_Proxied; +}; + +#endif // ORGANIZERPROXY_H -- cgit v1.3.1