diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-08 00:30:51 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-15 14:40:40 -0400 |
| commit | 57c7b1568518acefcbcc1801954a62fdc94e3b1c (patch) | |
| tree | 99b8b51ed60045b6ad299ef745abcf4260552889 /src/editexecutablesdialog.h | |
| parent | f60431f92f9475d59a3e2af41c95cc6723892f9a (diff) | |
moved functionality to CustomOverwrites and ForcedLibraries helper classes
Diffstat (limited to 'src/editexecutablesdialog.h')
| -rw-r--r-- | src/editexecutablesdialog.h | 43 |
1 files changed, 41 insertions, 2 deletions
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 <http://www.gnu.org/licenses/>. #include "iplugingame.h"
#include <QTimer>
#include <QAbstractButton>
+#include <optional>
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<QString> 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<QString, QString> m_map;
+};
+
+
+/** helper class to manage forced libraries within the edit executables dialog
+ **/
+class ForcedLibraries
+{
+public:
+ using list_type = QList<MOBase::ExecutableForcedLoadSetting>;
+
+ void load(Profile* p, const ExecutablesList& exes);
+ std::optional<list_type> 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<QString, list_type> m_map;
+};
+
+
/**
* @brief Dialog to manage the list of executables
**/
@@ -81,8 +120,8 @@ private slots: private:
std::unique_ptr<Ui::EditExecutablesDialog> ui;
ExecutablesList m_executablesList;
- std::map<QString, QString> m_customOverwrites;
- std::map<QString, QList<MOBase::ExecutableForcedLoadSetting>> m_forcedLibraries;
+ CustomOverwrites m_customOverwrites;
+ ForcedLibraries m_forcedLibraries;
Profile *m_profile;
const MOBase::IPluginGame *m_gamePlugin;
bool m_settingUI;
|
