From dce1993aefa18d280e9c796419da8323b912dfb8 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sun, 20 Sep 2020 12:30:41 +0200 Subject: Fix issue with global saves directory when setting files are availble for non-Bethesda games. --- src/mainwindow.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index b3682297..b597af37 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1893,12 +1893,16 @@ QDir MainWindow::currentSavesDir() const iniPath += "/" + iniFiles[0]; wchar_t path[MAX_PATH]; - ::GetPrivateProfileStringW( - L"General", L"SLocalSavePath", L"Saves", - path, MAX_PATH, - iniPath.toStdWString().c_str() - ); - savesDir.setPath(m_OrganizerCore.managedGame()->documentsDirectory().absoluteFilePath(QString::fromWCharArray(path))); + if (::GetPrivateProfileStringW( + L"General", L"SLocalSavePath", L"", + path, MAX_PATH, + iniPath.toStdWString().c_str() + )) { + savesDir.setPath(m_OrganizerCore.managedGame()->documentsDirectory().absoluteFilePath(QString::fromWCharArray(path))); + } + else { + savesDir = m_OrganizerCore.managedGame()->savesDirectory(); + } } return savesDir; -- cgit v1.3.1