diff options
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) |
