diff options
| author | Mikaƫl Capelle <capelle.mikael@gmail.com> | 2020-10-26 21:39:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-26 21:39:25 +0100 |
| commit | 57e67eeb392ea6d3d4af69ca40538147cc608e0f (patch) | |
| tree | 69976cb8870e1bffda3d149627123e1ecf24c654 | |
| parent | d42399e419fa6b769e343b8cf77480b6ac172b0f (diff) | |
| parent | 61308ae2a6ed1123d3043659e72e300dc5c68cca (diff) | |
Merge pull request #1269 from Holt59/imodlist-updates
IModList updates
| -rw-r--r-- | src/mainwindow.cpp | 32 | ||||
| -rw-r--r-- | src/modlist.cpp | 52 | ||||
| -rw-r--r-- | src/modlist.h | 42 | ||||
| -rw-r--r-- | src/modlistproxy.cpp | 25 | ||||
| -rw-r--r-- | src/modlistproxy.h | 5 | ||||
| -rw-r--r-- | src/organizercore.cpp | 52 | ||||
| -rw-r--r-- | src/organizercore.h | 18 | ||||
| -rw-r--r-- | src/organizerproxy.cpp | 24 | ||||
| -rw-r--r-- | src/organizerproxy.h | 7 |
9 files changed, 157 insertions, 100 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 18cc85f0..65c1d65c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1730,7 +1730,7 @@ void MainWindow::activateSelectedProfile() m_ModListSortProxy->setProfile(m_OrganizerCore.currentProfile()); refreshSaveList(); - m_OrganizerCore.refreshModList(); + m_OrganizerCore.refresh(); updateModCount(); updatePluginCount(); ui->statusBar->updateNormalMessage(m_OrganizerCore); @@ -2683,7 +2683,7 @@ void MainWindow::restoreBackup_clicked() if (!modDir.rename(modInfo->absolutePath(), destinationPath)) { reportError(tr("failed to rename \"%1\" to \"%2\"").arg(modInfo->absolutePath()).arg(destinationPath)); } - m_OrganizerCore.refreshModList(); + m_OrganizerCore.refresh(); } } } @@ -2833,7 +2833,7 @@ void MainWindow::backupMod_clicked() QMessageBox::information(this, tr("Failed"), tr("Failed to create backup.")); } - m_OrganizerCore.refreshModList(); + m_OrganizerCore.refresh(); } void MainWindow::resumeDownload(int downloadIndex) @@ -3603,7 +3603,7 @@ void MainWindow::createEmptyMod_clicked() } } - if (m_OrganizerCore.getMod(name) != nullptr) { + if (m_OrganizerCore.modList()->getMod(name) != nullptr) { reportError(tr("A mod with this name already exists")); return; } @@ -3618,7 +3618,7 @@ void MainWindow::createEmptyMod_clicked() return; } - m_OrganizerCore.refreshModList(); + m_OrganizerCore.refresh(); if (newPriority >= 0) { m_OrganizerCore.modList()->changeModPriority(ModInfo::getIndex(name), newPriority); @@ -3638,13 +3638,13 @@ void MainWindow::createSeparator_clicked() GUESS_USER); if (!ok) { return; } } - if (m_OrganizerCore.getMod(name) != nullptr) + if (m_OrganizerCore.modList()->getMod(name) != nullptr) { reportError(tr("A separator with this name already exists")); return; } name->append("_separator"); - if (m_OrganizerCore.getMod(name) != nullptr) + if (m_OrganizerCore.modList()->getMod(name) != nullptr) { return; } @@ -3656,7 +3656,7 @@ void MainWindow::createSeparator_clicked() } if (m_OrganizerCore.createMod(name) == nullptr) { return; } - m_OrganizerCore.refreshModList(); + m_OrganizerCore.refresh(); if (newPriority >= 0) { @@ -3739,7 +3739,7 @@ void MainWindow::createModFromOverwrite() } } - if (m_OrganizerCore.getMod(name) != nullptr) { + if (m_OrganizerCore.modList()->getMod(name) != nullptr) { reportError(tr("A mod with this name already exists")); return; } @@ -3775,7 +3775,7 @@ void MainWindow::moveOverwriteContentToExistingMod() QString modAbsolutePath; - for (const auto& mod : m_OrganizerCore.modsSortedByProfilePriority()) { + for (const auto& mod : m_OrganizerCore.modsSortedByProfilePriority(m_OrganizerCore.currentProfile())) { if (result.compare(mod) == 0) { ModInfo::Ptr modInfo = ModInfo::getByIndex(ModInfo::getIndex(mod)); modAbsolutePath = modInfo->absolutePath(); @@ -3811,7 +3811,7 @@ void MainWindow::doMoveOverwriteContentToMod(const QString &modAbsolutePath) log::error("Move operation failed: {}", formatSystemMessage(e)); } - m_OrganizerCore.refreshModList(); + m_OrganizerCore.refresh(); } void MainWindow::clearOverwrite() @@ -3835,7 +3835,7 @@ void MainWindow::clearOverwrite() delList.push_back(overwriteDir.absoluteFilePath(f)); if (shellDelete(delList, true)) { scheduleCheckForProblems(); - m_OrganizerCore.refreshModList(); + m_OrganizerCore.refresh(); } else { const auto e = GetLastError(); log::error("Delete operation failed: {}", formatSystemMessage(e)); @@ -5133,9 +5133,7 @@ void MainWindow::on_actionSettings_triggered() ui->dataTabShowFromArchives->setCheckState(Qt::Checked); ui->dataTabShowFromArchives->setEnabled(true); } - m_OrganizerCore.refreshModList(); - m_OrganizerCore.refreshDirectoryStructure(); - m_OrganizerCore.refreshLists(); + m_OrganizerCore.refresh(); } if (settings.paths().cache() != oldCacheDirectory) { @@ -6358,7 +6356,7 @@ void MainWindow::on_restoreModsButton_clicked() tr("Failed to restore the backup. Errorcode: %1") .arg(formatSystemMessage(e))); } - m_OrganizerCore.refreshModList(false); + m_OrganizerCore.refresh(false); } } @@ -6551,7 +6549,7 @@ void MainWindow::sendSelectedModsToSeparator_clicked() int newPriority = INT_MAX; bool foundSection = false; - for (auto mod : m_OrganizerCore.modsSortedByProfilePriority()) { + for (auto mod : m_OrganizerCore.modsSortedByProfilePriority(m_OrganizerCore.currentProfile())) { unsigned int modIndex = ModInfo::getIndex(mod); ModInfo::Ptr modInfo = ModInfo::getByIndex(modIndex); if (!foundSection && result.compare(mod) == 0) { diff --git a/src/modlist.cpp b/src/modlist.cpp index 2499bac0..f4c034dc 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -77,6 +77,8 @@ ModList::ModList(PluginContainer *pluginContainer, OrganizerCore *organizer) ModList::~ModList() { + m_ModInstalled.disconnect_all_slots(); + m_ModRemoved.disconnect_all_slots(); m_ModStateChanged.disconnect_all_slots(); m_ModMoved.disconnect_all_slots(); } @@ -929,6 +931,31 @@ QStringList ModList::allMods() const return result; } +QStringList ModList::allModsByProfilePriority(MOBase::IProfile* profile) const +{ + Profile* mo2Profile = profile == nullptr ? + m_Organizer->currentProfile() : static_cast<Profile*>(profile); + return m_Organizer->modsSortedByProfilePriority(mo2Profile); +} + +MOBase::IModInterface* ModList::getMod(const QString& name) const +{ + unsigned int index = ModInfo::getIndex(name); + return index == UINT_MAX ? nullptr : ModInfo::getByIndex(index).data(); +} + +bool ModList::removeMod(MOBase::IModInterface* mod) +{ + unsigned int index = ModInfo::getIndex(mod->name()); + if (index == UINT_MAX) { + return mod->remove(); + } + else { + return ModInfo::removeMod(index); + } + notifyModRemoved(mod->name()); +} + IModList::ModStates ModList::state(const QString &name) const { unsigned int modIndex = ModInfo::getIndex(name); @@ -1001,10 +1028,29 @@ bool ModList::setPriority(const QString &name, int newPriority) } } +bool ModList::onModInstalled(const std::function<void(MOBase::IModInterface*)>& func) +{ + return m_ModInstalled.connect(func).connected(); +} + +bool ModList::onModRemoved(const std::function<void(QString const&)>& func) +{ + return m_ModRemoved.connect(func).connected(); +} + bool ModList::onModStateChanged(const std::function<void(const std::map<QString, ModStates>&)>& func) { - auto conn = m_ModStateChanged.connect(func); - return conn.connected(); + return m_ModStateChanged.connect(func).connected(); +} + +void ModList::notifyModInstalled(MOBase::IModInterface* mod) const +{ + m_ModInstalled(mod); +} + +void ModList::notifyModRemoved(QString const& modName) const +{ + m_ModRemoved(modName); } void ModList::notifyModStateChanged(QList<unsigned int> modIndices) const @@ -1176,6 +1222,8 @@ void ModList::removeRowForce(int row, const QModelIndex &parent) m_Profile->refreshModStatus(); // removes the mod from the status list m_Profile->writeModlist(); // this ensures the modified list gets written back before new mods can be installed + notifyModRemoved(modInfo->name()); + if (wasEnabled) { emit removeOrigin(modInfo->name()); } diff --git a/src/modlist.h b/src/modlist.h index 5312db34..385ca04c 100644 --- a/src/modlist.h +++ b/src/modlist.h @@ -70,8 +70,10 @@ public: COL_LASTCOLUMN = COL_NOTES,
};
- typedef boost::signals2::signal<void (const std::map<QString, ModStates>&)> SignalModStateChanged;
- typedef boost::signals2::signal<void (const QString &, int, int)> SignalModMoved;
+ using SignalModInstalled = boost::signals2::signal<void(MOBase::IModInterface*)>;
+ using SignalModRemoved = boost::signals2::signal<void(QString const&)>;
+ using SignalModStateChanged = boost::signals2::signal<void (const std::map<QString, ModStates>&)>;
+ using SignalModMoved = boost::signals2::signal<void (const QString &, int, int)>;
public:
@@ -125,6 +127,22 @@ public: void highlightMods(const QItemSelectionModel *selection, const MOShared::DirectoryEntry &directoryEntry);
/**
+ * @brief Notify the mod list that the given mod has been installed. This is used
+ * to notify the plugin that registered through onModInstalled().
+ *
+ * @param mod The installed mod.
+ */
+ void notifyModInstalled(MOBase::IModInterface *mod) const;
+
+ /**
+ * @brief Notify the mod list that a mod has been removed. This is used
+ * to notify the plugin that registered through onModRemoved().
+ *
+ * @param modName Name of the removed mod.
+ */
+ void notifyModRemoved(QString const& modName) const;
+
+ /**
* @brief Notify the mod list that the state of the specified mods has changed. This is used
* to notify the plugin that registered through onModStateChanged().
*
@@ -139,6 +157,13 @@ public: /// \copydoc MOBase::IModList::allMods
virtual QStringList allMods() const override;
+ virtual QStringList allModsByProfilePriority(MOBase::IProfile* profile = nullptr) const override;
+
+ // \copydoc MOBase::IModList::getMod
+ MOBase::IModInterface* getMod(const QString& name) const override;
+
+ // \copydoc MOBase::IModList::remove
+ bool removeMod(MOBase::IModInterface* mod) override;
/// \copydoc MOBase::IModList::state
virtual ModStates state(const QString &name) const override;
@@ -155,11 +180,10 @@ public: /// \copydoc MOBase::IModList::setPriority
virtual bool setPriority(const QString &name, int newPriority) override;
- /// \copydoc MOBase::IModList::onModStateChanged
- virtual bool onModStateChanged(const std::function<void(const std::map<QString, ModStates>&)>& func) override;
-
- /// \copydoc MOBase::IModList::onModMoved
- virtual bool onModMoved(const std::function<void (const QString &, int, int)> &func) override;
+ bool onModInstalled(const std::function<void(MOBase::IModInterface*)>& func) override;
+ bool onModRemoved(const std::function<void(QString const&)>& func) override;
+ bool onModStateChanged(const std::function<void(const std::map<QString, ModStates>&)>& func) override;
+ bool onModMoved(const std::function<void (const QString &, int, int)> &func) override;
public: // implementation of virtual functions of QAbstractItemModel
@@ -362,8 +386,10 @@ private: TModInfoChange m_ChangeInfo;
- SignalModStateChanged m_ModStateChanged;
+ SignalModInstalled m_ModInstalled;
SignalModMoved m_ModMoved;
+ SignalModRemoved m_ModRemoved;
+ SignalModStateChanged m_ModStateChanged;
QElapsedTimer m_LastCheck;
diff --git a/src/modlistproxy.cpp b/src/modlistproxy.cpp index 7ec00c49..8fcbdbdf 100644 --- a/src/modlistproxy.cpp +++ b/src/modlistproxy.cpp @@ -17,6 +17,21 @@ QStringList ModListProxy::allMods() const return m_Proxied->allMods(); } +QStringList ModListProxy::allModsByProfilePriority(MOBase::IProfile* profile) const +{ + return m_Proxied->allModsByProfilePriority(profile); +} + +IModInterface* ModListProxy::getMod(const QString& name) const +{ + return m_Proxied->getMod(name); +} + +bool ModListProxy::removeMod(MOBase::IModInterface* mod) +{ + return m_Proxied->removeMod(mod); +} + IModList::ModStates ModListProxy::state(const QString& name) const { return m_Proxied->state(name); @@ -42,6 +57,16 @@ bool ModListProxy::setPriority(const QString& name, int newPriority) return m_Proxied->setPriority(name, newPriority); } +bool ModListProxy::onModInstalled(const std::function<void(IModInterface*)>& func) +{ + return m_Proxied->onModInstalled(MOShared::callIfPluginActive(m_OrganizerProxy, func)); +} + +bool ModListProxy::onModRemoved(const std::function<void(QString const&)>& func) +{ + return m_Proxied->onModRemoved(MOShared::callIfPluginActive(m_OrganizerProxy, func)); +} + bool ModListProxy::onModStateChanged(const std::function<void(const std::map<QString, ModStates>&)>& func) { return m_Proxied->onModStateChanged(MOShared::callIfPluginActive(m_OrganizerProxy, func)); diff --git a/src/modlistproxy.h b/src/modlistproxy.h index 13399e0a..c805cf4e 100644 --- a/src/modlistproxy.h +++ b/src/modlistproxy.h @@ -15,11 +15,16 @@ public: QString displayName(const QString& internalName) const override; QStringList allMods() const override; + QStringList allModsByProfilePriority(MOBase::IProfile* profile = nullptr) const override; + MOBase::IModInterface* getMod(const QString& name) const override; + bool removeMod(MOBase::IModInterface* mod) override; ModStates state(const QString& name) const override; bool setActive(const QString& name, bool active) override; int setActive(const QStringList& names, bool active) override; int priority(const QString& name) const override; bool setPriority(const QString& name, int newPriority) override; + bool onModInstalled(const std::function<void(MOBase::IModInterface *)>& func) override; + bool onModRemoved(const std::function<void(QString const&)>& func) override; bool onModStateChanged(const std::function<void(const std::map<QString, ModStates>&)>& func) override; bool onModMoved(const std::function<void(const QString&, int, int)>& func) override; diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 7c975053..b39d3ec0 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -301,7 +301,6 @@ void OrganizerCore::disconnectPlugins() { m_AboutToRun.disconnect_all_slots(); m_FinishedRun.disconnect_all_slots(); - m_ModInstalled.disconnect_all_slots(); m_UserInterfaceInitialized.disconnect_all_slots(); m_ProfileChanged.disconnect_all_slots(); m_PluginSettingChanged.disconnect_all_slots(); @@ -636,12 +635,6 @@ MOBase::VersionInfo OrganizerCore::appVersion() const return m_Updater.getVersion(); } -MOBase::IModInterface *OrganizerCore::getMod(const QString &name) const -{ - unsigned int index = ModInfo::getIndex(name); - return index == UINT_MAX ? nullptr : ModInfo::getByIndex(index).data(); -} - MOBase::IPluginGame *OrganizerCore::getGame(const QString &name) const { for (IPluginGame *game : m_PluginContainer->plugins<IPluginGame>()) { @@ -683,19 +676,9 @@ MOBase::IModInterface *OrganizerCore::createMod(GuessedValue<QString> &name) .data(); } -bool OrganizerCore::removeMod(MOBase::IModInterface *mod) -{ - unsigned int index = ModInfo::getIndex(mod->name()); - if (index == UINT_MAX) { - return mod->remove(); - } else { - return ModInfo::removeMod(index); - } -} - void OrganizerCore::modDataChanged(MOBase::IModInterface *) { - refreshModList(false); + refresh(false); } QVariant OrganizerCore::pluginSetting(const QString &pluginName, @@ -757,7 +740,7 @@ MOBase::IModInterface *OrganizerCore::installMod(const QString &fileName, if (result == IPluginInstaller::RESULT_SUCCESS) { MessageDialog::showMessage(tr("Installation successful"), qApp->activeWindow()); - refreshModList(); + refresh(); int modIndex = ModInfo::getIndex(modName); if (modIndex != UINT_MAX) { @@ -777,7 +760,7 @@ MOBase::IModInterface *OrganizerCore::installMod(const QString &fileName, m_UserInterface->displayModInformation( modInfo, modIndex, ModInfoTabIDs::IniFiles); } - m_ModInstalled(modName); + m_ModList.notifyModInstalled(modInfo.get()); m_DownloadManager.markInstalled(fileName); m_InstallationManager.notifyInstallationEnd(result, modInfo); emit modInstalled(modName); @@ -793,7 +776,7 @@ MOBase::IModInterface *OrganizerCore::installMod(const QString &fileName, "If this was prior to a FOMOD setup, this warning may be ignored. " "However, if this was during installation, the mod will likely be missing files."), QMessageBox::Ok); - refreshModList(); + refresh(); } } return nullptr; @@ -839,7 +822,7 @@ void OrganizerCore::installDownload(int index) if (result == IPluginInstaller::RESULT_SUCCESS) { MessageDialog::showMessage(tr("Installation successful"), qApp->activeWindow()); - refreshModList(); + refresh(); int modIndex = ModInfo::getIndex(modName); if (modIndex != UINT_MAX) { @@ -856,7 +839,7 @@ void OrganizerCore::installDownload(int index) modInfo, modIndex, ModInfoTabIDs::IniFiles); } - m_ModInstalled(modName); + m_ModList.notifyModInstalled(modInfo.get()); m_InstallationManager.notifyInstallationEnd(IPluginInstaller::RESULT_SUCCESS, modInfo); } else { reportError(tr("mod not found: %1").arg(qUtf8Printable(modName))); @@ -872,7 +855,7 @@ void OrganizerCore::installDownload(int index) "If this was prior to a FOMOD setup, this warning may be ignored. " "However, if this was during installation, the mod will likely be missing files."), QMessageBox::Ok); - refreshModList(); + refresh(); } } } catch (const std::exception &e) { @@ -991,13 +974,13 @@ ModList *OrganizerCore::modList() return &m_ModList; } -QStringList OrganizerCore::modsSortedByProfilePriority() const +QStringList OrganizerCore::modsSortedByProfilePriority(Profile *profile) const { QStringList res; - for (int i = currentProfile()->getPriorityMinimum(); - i < currentProfile()->getPriorityMinimum() + (int)currentProfile()->numRegularMods(); + for (int i = profile->getPriorityMinimum(); + i < profile->getPriorityMinimum() + (int)profile->numRegularMods(); ++i) { - int modIndex = currentProfile()->modIndexByPriority(i); + int modIndex = profile->modIndexByPriority(i); auto modInfo = ModInfo::getByIndex(modIndex); if (!modInfo->hasFlag(ModInfo::FLAG_OVERWRITE) && !modInfo->hasFlag(ModInfo::FLAG_BACKUP)) { @@ -1149,13 +1132,6 @@ bool OrganizerCore::onFinishedRun( return conn.connected(); } -bool OrganizerCore::onModInstalled( - const std::function<void(const QString &)> &func) -{ - auto conn = m_ModInstalled.connect(func); - return conn.connected(); -} - bool OrganizerCore::onUserInterfaceInitialized(std::function<void(QMainWindow*)> const& func) { return m_UserInterfaceInitialized.connect(func).connected(); @@ -1186,7 +1162,7 @@ bool OrganizerCore::onPluginSettingChanged(std::function<void(QString const&, co return m_PluginSettingChanged.connect(func).connected(); } -void OrganizerCore::refreshModList(bool saveChanges) +void OrganizerCore::refresh(bool saveChanges) { // don't lose changes! if (saveChanges) { @@ -1207,6 +1183,8 @@ void OrganizerCore::refreshModList(bool saveChanges) void OrganizerCore::refreshESPList(bool force) { + TimeThis tt("OrganizerCore::refreshESPList()"); + if (m_DirectoryUpdate) { // don't mess up the esp list if we're currently updating the directory // structure @@ -1565,7 +1543,7 @@ void OrganizerCore::directory_refreshed() void OrganizerCore::profileRefresh() { - refreshModList(); + refresh(); } void OrganizerCore::modStatusChanged(unsigned int index) diff --git a/src/organizercore.h b/src/organizercore.h index b545e4d7..70ce94f5 100644 --- a/src/organizercore.h +++ b/src/organizercore.h @@ -80,7 +80,6 @@ private: using SignalAboutToRunApplication = boost::signals2::signal<bool (const QString&), SignalCombinerAnd>;
using SignalFinishedRunApplication = boost::signals2::signal<void (const QString&, unsigned int)>;
- using SignalModInstalled = boost::signals2::signal<void (const QString&)>;
using SignalUserInterfaceInitialized = boost::signals2::signal<void (QMainWindow*)>;
using SignalProfileCreated = boost::signals2::signal<void(MOBase::IProfile*)>;
using SignalProfileRenamed = boost::signals2::signal<void(MOBase::IProfile*, QString const&, QString const&)>;
@@ -293,6 +292,15 @@ public: static void setGlobalCrashDumpsType(CrashDumpsType crashDumpsType);
static std::wstring crashDumpsPath();
+ /**
+ * @brief Returns the name of all the mods in the priority order of the given profile.
+ *
+ * @param profile Profile to use for the mod order.
+ *
+ * @return the name of all the mods in the priority order of the given profile.
+ */
+ QStringList modsSortedByProfilePriority(Profile* profile) const;
+
public:
MOBase::IModRepositoryBridge *createNexusBridge() const;
QString profileName() const;
@@ -302,10 +310,8 @@ public: QString basePath() const;
QString modsPath() const;
MOBase::VersionInfo appVersion() const;
- MOBase::IModInterface *getMod(const QString &name) const;
MOBase::IPluginGame *getGame(const QString &gameName) const;
MOBase::IModInterface *createMod(MOBase::GuessedValue<QString> &name);
- bool removeMod(MOBase::IModInterface *mod);
void modDataChanged(MOBase::IModInterface *mod);
QVariant pluginSetting(const QString &pluginName, const QString &key) const;
void setPluginSetting(const QString &pluginName, const QString &key, const QVariant &value);
@@ -321,11 +327,8 @@ public: DownloadManager *downloadManager();
PluginList *pluginList();
ModList *modList();
- void refreshModList(bool saveChanges = true);
- QStringList modsSortedByProfilePriority() const;
-
+ void refresh(bool saveChanges = true);
- bool onModInstalled(const std::function<void(const QString&)>& func);
bool onAboutToRun(const std::function<bool(const QString&)>& func);
bool onFinishedRun(const std::function<void(const QString&, unsigned int)>& func);
bool onUserInterfaceInitialized(std::function<void(QMainWindow*)> const& func);
@@ -450,7 +453,6 @@ private: SignalAboutToRunApplication m_AboutToRun;
SignalFinishedRunApplication m_FinishedRun;
- SignalModInstalled m_ModInstalled;
SignalUserInterfaceInitialized m_UserInterfaceInitialized;
SignalProfileCreated m_ProfileCreated;
SignalProfileRenamed m_ProfileRenamed;
diff --git a/src/organizerproxy.cpp b/src/organizerproxy.cpp index df73603a..45efc00c 100644 --- a/src/organizerproxy.cpp +++ b/src/organizerproxy.cpp @@ -67,11 +67,6 @@ VersionInfo OrganizerProxy::appVersion() const return m_Proxied->appVersion();
}
-IModInterface *OrganizerProxy::getMod(const QString &name) const
-{
- return m_Proxied->getMod(name);
-}
-
IPluginGame *OrganizerProxy::getGame(const QString &gameName) const
{
return m_Proxied->getGame(gameName);
@@ -82,11 +77,6 @@ IModInterface *OrganizerProxy::createMod(MOBase::GuessedValue<QString> &name) return m_Proxied->createMod(name);
}
-bool OrganizerProxy::removeMod(IModInterface *mod)
-{
- return m_Proxied->removeMod(mod);
-}
-
void OrganizerProxy::modDataChanged(IModInterface *mod)
{
m_Proxied->modDataChanged(mod);
@@ -178,9 +168,9 @@ bool OrganizerProxy::waitForApplication(HANDLE handle, LPDWORD exitCode) const }
}
-void OrganizerProxy::refreshModList(bool saveChanges)
+void OrganizerProxy::refresh(bool saveChanges)
{
- m_Proxied->refreshModList(saveChanges);
+ m_Proxied->refresh(saveChanges);
}
IModInterface *OrganizerProxy::installMod(const QString &fileName, const QString &nameSuggestion)
@@ -254,11 +244,6 @@ MOBase::IPluginGame const *OrganizerProxy::managedGame() const return m_Proxied->managedGame();
}
-QStringList OrganizerProxy::modsSortedByProfilePriority() const
-{
- return m_Proxied->modsSortedByProfilePriority();
-}
-
// CALLBACKS
bool OrganizerProxy::onAboutToRun(const std::function<bool(const QString&)>& func)
@@ -271,11 +256,6 @@ bool OrganizerProxy::onFinishedRun(const std::function<void(const QString&, unsi return m_Proxied->onFinishedRun(MOShared::callIfPluginActive(this, func));
}
-bool OrganizerProxy::onModInstalled(const std::function<void(const QString&)>& func)
-{
- return m_Proxied->onModInstalled(MOShared::callIfPluginActive(this, func));
-}
-
bool OrganizerProxy::onUserInterfaceInitialized(std::function<void(QMainWindow*)> const& func)
{
// Always call this one to allow plugin to initialize themselves even when not active:
diff --git a/src/organizerproxy.h b/src/organizerproxy.h index 376d1a1a..6690d612 100644 --- a/src/organizerproxy.h +++ b/src/organizerproxy.h @@ -32,10 +32,8 @@ public: virtual QString basePath() const;
virtual QString modsPath() const;
virtual MOBase::VersionInfo appVersion() const;
- virtual MOBase::IModInterface *getMod(const QString &name) const;
virtual MOBase::IPluginGame *getGame(const QString &gameName) const;
virtual MOBase::IModInterface *createMod(MOBase::GuessedValue<QString> &name);
- virtual bool removeMod(MOBase::IModInterface *mod);
virtual void modDataChanged(MOBase::IModInterface *mod);
virtual QVariant pluginSetting(const QString &pluginName, const QString &key) const;
virtual void setPluginSetting(const QString &pluginName, const QString &key, const QVariant &value);
@@ -57,11 +55,10 @@ public: virtual HANDLE startApplication(const QString &executable, const QStringList &args = QStringList(), const QString &cwd = "",
const QString &profile = "", const QString &forcedCustomOverwrite = "", bool ignoreCustomOverwrite = false);
virtual bool waitForApplication(HANDLE handle, LPDWORD exitCode = nullptr) const;
- virtual void refreshModList(bool saveChanges);
+ virtual void refresh(bool saveChanges);
virtual bool onAboutToRun(const std::function<bool(const QString&)> &func) override;
virtual bool onFinishedRun(const std::function<void (const QString&, unsigned int)> &func) override;
- virtual bool onModInstalled(const std::function<void (const QString&)> &func) override;
virtual bool onUserInterfaceInitialized(std::function<void(QMainWindow*)> const& func) override;
virtual bool onProfileCreated(std::function<void(MOBase::IProfile*)> const& func) override;
virtual bool onProfileRenamed(std::function<void(MOBase::IProfile*, QString const&, QString const&)> const& func) override;
@@ -71,8 +68,6 @@ public: virtual MOBase::IPluginGame const *managedGame() const;
- virtual QStringList modsSortedByProfilePriority() const;
-
private:
OrganizerCore *m_Proxied;
|
