diff options
| author | LostDragonist <lost.dragonist@gmail.com> | 2018-12-11 01:52:53 -0600 |
|---|---|---|
| committer | LostDragonist <lost.dragonist@gmail.com> | 2018-12-11 01:52:53 -0600 |
| commit | 1266e13921812ac647e1b788fab5eb04e8267ec9 (patch) | |
| tree | 818fd1035d5a051aec57a284049b1fc833a8b9d5 /src/settings.cpp | |
| parent | f4af3264f049425610d3c829ce1d92482191daf4 (diff) | |
Add the ability to change the managed game directory
Diffstat (limited to 'src/settings.cpp')
| -rw-r--r-- | src/settings.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/settings.cpp b/src/settings.cpp index b067106f..5db656d8 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -298,6 +298,11 @@ QString Settings::getModDirectory(bool resolve) const return getConfigurablePath("mod_directory", ToQString(AppConfig::modsPath()), resolve); } +QString Settings::getManagedGameDirectory() const +{ + return m_Settings.value("gamePath", "").toString(); +} + QString Settings::getProfileDirectory(bool resolve) const { return getConfigurablePath("profiles_directory", ToQString(AppConfig::profilesPath()), resolve); @@ -882,6 +887,12 @@ void Settings::PathsTab::update() } else { m_Settings.remove("Settings/base_directory"); } + + QFileInfo oldGameExe(m_parent->m_GamePlugin->gameDirectory().absoluteFilePath(m_parent->m_GamePlugin->binaryName())); + QFileInfo newGameExe(m_managedGameDirEdit->text()); + if (oldGameExe != newGameExe) { + m_Settings.setValue("gamePath", newGameExe.absolutePath()); + } } Settings::DiagnosticsTab::DiagnosticsTab(Settings *m_parent, SettingsDialog &m_dialog) |
