From 347ac2b8b5f34a2583ae7844e0dfd79773657270 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Fri, 11 Jan 2019 01:39:05 -0600 Subject: Support for force loading libraries --- src/profile.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/profile.h') diff --git a/src/profile.h b/src/profile.h index 95a5c59d..d7fb7785 100644 --- a/src/profile.h +++ b/src/profile.h @@ -24,12 +24,14 @@ along with Mod Organizer. If not, see . #include "modinfo.h" #include #include +#include "executableinfo.h" #include #include #include #include #include +#include #include @@ -310,8 +312,19 @@ public: void removeSetting(const QString §ion, const QString &name = QString()); void removeSetting(const QString &name); + QVariantMap settingsByGroup(const QString §ion) const; + void storeSettingsByGroup(const QString §ion, const QVariantMap &values); + + QList settingsByArray(const QString &prefix) const; + void storeSettingsByArray(const QString &prefix, const QList &values); + int getPriorityMinimum() const; + bool forcedLibrariesEnabled(const QString &executable); + void setForcedLibrariesEnabled(const QString &executable, bool enabled); + QList determineForcedLibraries(const QString &executable); + void saveForcedLibraries(const QString &executable, const QList &values); + signals: /** -- cgit v1.3.1 From 64a242d9220868a5b564c32f75f191efb01ad18e Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Fri, 11 Jan 2019 16:21:43 -0600 Subject: Remove profile-specific executable settings when removing the executable --- src/editexecutablesdialog.cpp | 4 +++- src/profile.cpp | 7 ++++++- src/profile.h | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src/profile.h') diff --git a/src/editexecutablesdialog.cpp b/src/editexecutablesdialog.cpp index 4b1cdb5d..bea497ef 100644 --- a/src/editexecutablesdialog.cpp +++ b/src/editexecutablesdialog.cpp @@ -124,7 +124,7 @@ void EditExecutablesDialog::saveExecutable() m_Profile->removeSetting("custom_overwrites", ui->titleEdit->text()); } - m_Profile->saveForcedLibraries(ui->titleEdit->text(), m_ForcedLibraries); + m_Profile->storeForcedLibraries(ui->titleEdit->text(), m_ForcedLibraries); m_Profile->setForcedLibrariesEnabled(ui->titleEdit->text(), ui->forceLoadCheckBox->isChecked()); } @@ -218,6 +218,8 @@ void EditExecutablesDialog::on_removeButton_clicked() { if (QMessageBox::question(this, tr("Confirm"), tr("Really remove \"%1\" from executables?").arg(ui->titleEdit->text()), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { + m_Profile->removeSetting("custom_overwrites", ui->titleEdit->text()); + m_Profile->removeForcedLibraries(ui->titleEdit->text()); m_ExecutablesList.remove(ui->titleEdit->text()); } diff --git a/src/profile.cpp b/src/profile.cpp index 02257de9..afe6fdc7 100644 --- a/src/profile.cpp +++ b/src/profile.cpp @@ -1014,7 +1014,7 @@ QList Profile::determineForcedLibraries(const QStri return results; } -void Profile::saveForcedLibraries(const QString &executable, const QList &values) +void Profile::storeForcedLibraries(const QString &executable, const QList &values) { QList rawSettings; for (auto setting : values) { @@ -1026,3 +1026,8 @@ void Profile::saveForcedLibraries(const QString &executable, const QListremove("forced_libraries/" + executable); +} diff --git a/src/profile.h b/src/profile.h index d7fb7785..dea933ad 100644 --- a/src/profile.h +++ b/src/profile.h @@ -323,7 +323,8 @@ public: bool forcedLibrariesEnabled(const QString &executable); void setForcedLibrariesEnabled(const QString &executable, bool enabled); QList determineForcedLibraries(const QString &executable); - void saveForcedLibraries(const QString &executable, const QList &values); + void storeForcedLibraries(const QString &executable, const QList &values); + void removeForcedLibraries(const QString &executable); signals: -- cgit v1.3.1