diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-09-27 20:59:54 +0200 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-09-27 20:59:54 +0200 |
| commit | 39b7f4abe972fb6bfbaea7764b81402099b5a0db (patch) | |
| tree | 47caddfcf7595b8a645569413ebac1b2734985c2 /src/profile.cpp | |
| parent | 7c651f6d8697bc572e521046c7f514baf96cacb3 (diff) | |
Fix gameDirectory() -> documentsDirectory(). Use QFileInfo more properly.
Diffstat (limited to 'src/profile.cpp')
| -rw-r--r-- | src/profile.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/profile.cpp b/src/profile.cpp index 97d31e69..6bf282d0 100644 --- a/src/profile.cpp +++ b/src/profile.cpp @@ -893,12 +893,12 @@ QString Profile::absoluteIniFilePath(QString iniFile) const { // This is the file to which the given iniFile would be mapped, as // an absolute file path: - QString targetIniFile = m_GamePlugin->gameDirectory().absoluteFilePath(iniFile); + QFileInfo targetIniFile(m_GamePlugin->documentsDirectory(), iniFile); bool isGameIni = false; for (auto gameIni : m_GamePlugin->iniFiles()) { // We compare the target file, not the actual ones: - if (m_GamePlugin->gameDirectory().absoluteFilePath(gameIni) == targetIniFile) { + if (QFileInfo(m_GamePlugin->documentsDirectory(), gameIni) == targetIniFile) { isGameIni = true; break; } @@ -907,11 +907,11 @@ QString Profile::absoluteIniFilePath(QString iniFile) const // Local-settings are not enabled, or the iniFile is not in the list of INI // files for the current game. if (!localSettingsEnabled() || !isGameIni) { - return m_GamePlugin->documentsDirectory().absoluteFilePath(iniFile); + return targetIniFile.absoluteFilePath(); } // If we reach here, the file is in the profile: - return m_Directory.absoluteFilePath(QFileInfo(targetIniFile).fileName()); + return m_Directory.absoluteFilePath(targetIniFile.fileName()); } QString Profile::getProfileTweaks() const |
