From 37b42df112791f20609784a8f36c65fe828388d9 Mon Sep 17 00:00:00 2001 From: Mikaël Capelle Date: Sun, 27 Sep 2020 20:06:37 +0200 Subject: Allow absolute path for ini files. --- src/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index fb71eca3..9a6b83d1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1887,10 +1887,10 @@ QDir MainWindow::currentSavesDir() const return m_OrganizerCore.managedGame()->savesDirectory(); } - QString iniPath = m_OrganizerCore.currentProfile()->localSettingsEnabled() + QDir iniDir = m_OrganizerCore.currentProfile()->localSettingsEnabled() ? m_OrganizerCore.currentProfile()->absolutePath() : m_OrganizerCore.managedGame()->documentsDirectory().absolutePath(); - iniPath += "/" + iniFiles[0]; + QString iniPath = iniDir.absoluteFilePath(iniFiles[0]); wchar_t path[MAX_PATH]; if (::GetPrivateProfileStringW( -- cgit v1.3.1 From 718e71854e01332f4a31d9961f5597b521bb994f Mon Sep 17 00:00:00 2001 From: Mikaël Capelle Date: Sun, 27 Sep 2020 21:28:14 +0200 Subject: Use IProfile::absoluteIniFilePath(). --- src/mainwindow.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 9a6b83d1..a20dfd06 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1887,10 +1887,7 @@ QDir MainWindow::currentSavesDir() const return m_OrganizerCore.managedGame()->savesDirectory(); } - QDir iniDir = m_OrganizerCore.currentProfile()->localSettingsEnabled() - ? m_OrganizerCore.currentProfile()->absolutePath() - : m_OrganizerCore.managedGame()->documentsDirectory().absolutePath(); - QString iniPath = iniDir.absoluteFilePath(iniFiles[0]); + QString iniPath = m_OrganizerCore.currentProfile()->absoluteIniFilePath(iniFiles[0]); wchar_t path[MAX_PATH]; if (::GetPrivateProfileStringW( -- cgit v1.3.1