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/organizerproxy.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/organizerproxy.h') diff --git a/src/organizerproxy.h b/src/organizerproxy.h index 8950217d..cc059aa9 100644 --- a/src/organizerproxy.h +++ b/src/organizerproxy.h @@ -1,18 +1,28 @@ #ifndef ORGANIZERPROXY_H #define ORGANIZERPROXY_H +#include +#include #include class OrganizerCore; class PluginContainer; +class DownloadManagerProxy; +class ModListProxy; +class PluginListProxy; class OrganizerProxy : public MOBase::IOrganizer { public: - OrganizerProxy(OrganizerCore *organizer, PluginContainer *pluginContainer, const QString &pluginName); + OrganizerProxy(OrganizerCore *organizer, PluginContainer *pluginContainer, MOBase::IPlugin *plugin); + + /** + * @return the plugin corresponding to this proxy. + */ + MOBase::IPlugin* plugin() const { return m_Plugin; } virtual MOBase::IModRepositoryBridge *createNexusBridge() const; virtual QString profileName() const; @@ -65,7 +75,11 @@ private: OrganizerCore *m_Proxied; PluginContainer *m_PluginContainer; - QString m_PluginName; + MOBase::IPlugin *m_Plugin; + + std::unique_ptr m_DownloadManagerProxy; + std::unique_ptr m_ModListProxy; + std::unique_ptr m_PluginListProxy; }; -- cgit v1.3.1