summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-03-28 07:34:25 -0700
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-04-08 13:47:09 +0200
commit12ac98a5375f38a190925ef59bc923318a37fd0f (patch)
tree2695f64d6369edb511d25f83e4d20b42d8b3a593 /src/client.cpp
parent8aa84d089e4233e17a6263cb0cf629331e63d051 (diff)
downloadmana-12ac98a5375f38a190925ef59bc923318a37fd0f.tar.gz
mana-12ac98a5375f38a190925ef59bc923318a37fd0f.tar.bz2
mana-12ac98a5375f38a190925ef59bc923318a37fd0f.tar.xz
mana-12ac98a5375f38a190925ef59bc923318a37fd0f.zip
Windows: Modernize getSpecialFolderLocation
Ported from CSIDL to newer FOLDERID API and used wcstombs_s to convert the returned path to a multi-byte string. Fixes issues when the Windows username contains special characters.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 63452112..abd426ce 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -1116,7 +1116,7 @@ void Client::initHomeDir()
mLocalDataDir = PHYSFS_getUserDir();
mLocalDataDir += "/config/data/Mana";
#elif defined _WIN32
- mLocalDataDir = getSpecialFolderLocation(CSIDL_LOCAL_APPDATA);
+ mLocalDataDir = getSpecialFolderLocation(FOLDERID_LocalAppData);
if (mLocalDataDir.empty())
mLocalDataDir = PHYSFS_getUserDir();
mLocalDataDir += "/Mana";
@@ -1281,9 +1281,9 @@ void Client::initScreenshotDir()
else if (mScreenshotDir.empty())
{
#ifdef _WIN32
- mScreenshotDir = getSpecialFolderLocation(CSIDL_MYPICTURES);
+ mScreenshotDir = getSpecialFolderLocation(FOLDERID_Pictures);
if (mScreenshotDir.empty())
- mScreenshotDir = getSpecialFolderLocation(CSIDL_DESKTOP);
+ mScreenshotDir = getSpecialFolderLocation(FOLDERID_Desktop);
#else
mScreenshotDir = std::string(PHYSFS_getUserDir()) + "Desktop";
#endif