# HG changeset patch # User alfadur # Date 1556741482 -10800 # Node ID 18bfa0a3c117a6e7930ff95562fa2fde4c46cc12 # Parent 0f39f8efbd2e9e76f8f71bce432ca6b63f7bf440 fix getting settings directory on windows diff -r 0f39f8efbd2e -r 18bfa0a3c117 QTfrontend/main.cpp --- a/QTfrontend/main.cpp Wed May 01 21:59:41 2019 +0300 +++ b/QTfrontend/main.cpp Wed May 01 23:11:22 2019 +0300 @@ -328,10 +328,10 @@ checkForDir(cfgdir->absolutePath() + "/Library/Application Support/Hedgewars"); cfgdir->cd("Library/Application Support/Hedgewars"); #elif defined _WIN32 - char path[1024]; - if(!SHGetFolderPathA(0, CSIDL_PERSONAL, NULL, 0, path)) + wchar_t path[MAX_PATH]; + if(SHGetFolderPathW(0, CSIDL_PERSONAL, NULL, 0, path) == S_OK) { - cfgdir->cd(path); + cfgdir->cd(QString::fromWCharArray(path)); checkForDir(cfgdir->absolutePath() + "/Hedgewars"); cfgdir->cd("Hedgewars"); }