From 4c5e3da2334a1d0c474148be8881b46d6ca6d3fa Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Mon, 17 Aug 2020 05:06:26 -0400 Subject: moved nexus api stuff to GlobalSettings pass a pointer to Settings around for things that can be called without settings, when creating the first instance added dummy plugin list, mod list and iorganizer to initialize plugins without an instance moved PluginContainer into the core filter, had nothing to do with the plugins list NexusInterface is now created manually instead of being a static singleton because it needs to know if the settings are available --- src/organizerproxy.cpp | 212 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 212 insertions(+) (limited to 'src/organizerproxy.cpp') diff --git a/src/organizerproxy.cpp b/src/organizerproxy.cpp index 45efc00c..8cc95a8b 100644 --- a/src/organizerproxy.cpp +++ b/src/organizerproxy.cpp @@ -287,3 +287,215 @@ bool OrganizerProxy::onPluginSettingChanged(std::functiononPluginSettingChanged(func); } + + + +DummyOrganizerProxy::DummyOrganizerProxy(const QString &pluginName) : + m_PluginName(pluginName), + m_mods(new DummyModList), m_plugins(new DummyPluginList) +{ +} + +DummyOrganizerProxy::~DummyOrganizerProxy() = default; + +IModRepositoryBridge *DummyOrganizerProxy::createNexusBridge() const +{ + return nullptr; +} + +QString DummyOrganizerProxy::profileName() const +{ + return {}; +} + +QString DummyOrganizerProxy::profilePath() const +{ + return {}; +} + +QString DummyOrganizerProxy::downloadsPath() const +{ + return {}; +} + +QString DummyOrganizerProxy::overwritePath() const +{ + return {}; +} + +QString DummyOrganizerProxy::basePath() const +{ + return {}; +} + +QString DummyOrganizerProxy::modsPath() const +{ + return {}; +} + +VersionInfo DummyOrganizerProxy::appVersion() const +{ + return {}; +} + +IModInterface *DummyOrganizerProxy::getMod(const QString &name) const +{ + return nullptr; +} + +IPluginGame *DummyOrganizerProxy::getGame(const QString &gameName) const +{ + return nullptr; +} + +IModInterface *DummyOrganizerProxy::createMod(MOBase::GuessedValue &name) +{ + return nullptr; +} + +bool DummyOrganizerProxy::removeMod(IModInterface *mod) +{ + return true; +} + +void DummyOrganizerProxy::modDataChanged(IModInterface *mod) +{ +} + +QVariant DummyOrganizerProxy::pluginSetting(const QString &pluginName, const QString &key) const +{ + if (key == "enabled") { + return true; + } + + return {}; +} + +void DummyOrganizerProxy::setPluginSetting(const QString &pluginName, const QString &key, const QVariant &value) +{ +} + +QVariant DummyOrganizerProxy::persistent(const QString &pluginName, const QString &key, const QVariant &def) const +{ + return {}; +} + +void DummyOrganizerProxy::setPersistent(const QString &pluginName, const QString &key, const QVariant &value, bool sync) +{ +} + +QString DummyOrganizerProxy::pluginDataPath() const +{ + return qApp->applicationDirPath() + "/" + ToQString(AppConfig::pluginPath()) + "/data"; +} + +HANDLE DummyOrganizerProxy::startApplication( + const QString& exe, const QStringList& args, const QString &cwd, + const QString& profile, const QString &overwrite, bool ignoreOverwrite) +{ + return INVALID_HANDLE_VALUE; +} + +bool DummyOrganizerProxy::waitForApplication(HANDLE handle, LPDWORD exitCode) const +{ + return true; +} + +bool DummyOrganizerProxy::onAboutToRun(const std::function &func) +{ + return true; +} + +bool DummyOrganizerProxy::onFinishedRun(const std::function &func) +{ + return true; +} + +bool DummyOrganizerProxy::onModInstalled(const std::function &func) +{ + return true; +} + +bool DummyOrganizerProxy::onUserInterfaceInitialized(std::function const& func) +{ + return true; +} + +bool DummyOrganizerProxy::onProfileChanged(std::function const& func) +{ + return true; +} + +bool DummyOrganizerProxy::onPluginSettingChanged(std::function const& func) +{ + return true; +} + +void DummyOrganizerProxy::refreshModList(bool saveChanges) +{ +} + +IModInterface *DummyOrganizerProxy::installMod(const QString &fileName, const QString &nameSuggestion) +{ + return nullptr; +} + +QString DummyOrganizerProxy::resolvePath(const QString &fileName) const +{ + return {}; +} + +QStringList DummyOrganizerProxy::listDirectories(const QString &directoryName) const +{ + return {}; +} + +QStringList DummyOrganizerProxy::findFiles(const QString &path, const std::function &filter) const +{ + return {}; +} + +QStringList DummyOrganizerProxy::findFiles(const QString& path, const QStringList& globFilters) const +{ + return {}; +} + +QStringList DummyOrganizerProxy::getFileOrigins(const QString &fileName) const +{ + return {}; +} + +QList DummyOrganizerProxy::findFileInfos(const QString &path, const std::function &filter) const +{ + return {}; +} + +MOBase::IDownloadManager *DummyOrganizerProxy::downloadManager() const +{ + return nullptr; +} + +MOBase::IPluginList *DummyOrganizerProxy::pluginList() const +{ + return m_plugins.get(); +} + +MOBase::IModList *DummyOrganizerProxy::modList() const +{ + return m_mods.get(); +} + +MOBase::IProfile *DummyOrganizerProxy::profile() const +{ + return nullptr; +} + +MOBase::IPluginGame const *DummyOrganizerProxy::managedGame() const +{ + return nullptr; +} + +QStringList DummyOrganizerProxy::modsSortedByProfilePriority() const +{ + return {}; +} -- cgit v1.3.1