From 57c7b1568518acefcbcc1801954a62fdc94e3b1c Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Sat, 8 Jun 2019 00:30:51 -0400 Subject: moved functionality to CustomOverwrites and ForcedLibraries helper classes --- src/editexecutablesdialog.h | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'src/editexecutablesdialog.h') diff --git a/src/editexecutablesdialog.h b/src/editexecutablesdialog.h index 3145c94f..f8382915 100644 --- a/src/editexecutablesdialog.h +++ b/src/editexecutablesdialog.h @@ -27,6 +27,7 @@ along with Mod Organizer. If not, see . #include "iplugingame.h" #include #include +#include namespace Ui { class EditExecutablesDialog; @@ -34,6 +35,44 @@ namespace Ui { class ModList; + +/** helper class to manage custom overwrites within the edit executables + * dialog + **/ +class CustomOverwrites +{ +public: + void load(Profile* p, const ExecutablesList& exes); + std::optional find(const QString& title) const; + + void set(const QString& title, const QString& mod); + void rename(const QString& oldTitle, const QString& newTitle); + void remove(const QString& title); + +private: + std::map m_map; +}; + + +/** helper class to manage forced libraries within the edit executables dialog + **/ +class ForcedLibraries +{ +public: + using list_type = QList; + + void load(Profile* p, const ExecutablesList& exes); + std::optional find(const QString& title) const; + + void set(const QString& title, const list_type& list); + void rename(const QString& oldTitle, const QString& newTitle); + void remove(const QString& title); + +private: + std::map m_map; +}; + + /** * @brief Dialog to manage the list of executables **/ @@ -81,8 +120,8 @@ private slots: private: std::unique_ptr ui; ExecutablesList m_executablesList; - std::map m_customOverwrites; - std::map> m_forcedLibraries; + CustomOverwrites m_customOverwrites; + ForcedLibraries m_forcedLibraries; Profile *m_profile; const MOBase::IPluginGame *m_gamePlugin; bool m_settingUI; -- cgit v1.3.1