QTfrontend/main.cpp
changeset 14877 18bfa0a3c117
parent 14861 cd0af25c7913
child 14892 a414d37278df
equal deleted inserted replaced
14876:0f39f8efbd2e 14877:18bfa0a3c117
   326     {
   326     {
   327 #ifdef __APPLE__
   327 #ifdef __APPLE__
   328         checkForDir(cfgdir->absolutePath() + "/Library/Application Support/Hedgewars");
   328         checkForDir(cfgdir->absolutePath() + "/Library/Application Support/Hedgewars");
   329         cfgdir->cd("Library/Application Support/Hedgewars");
   329         cfgdir->cd("Library/Application Support/Hedgewars");
   330 #elif defined _WIN32
   330 #elif defined _WIN32
   331         char path[1024];
   331         wchar_t path[MAX_PATH];
   332         if(!SHGetFolderPathA(0, CSIDL_PERSONAL, NULL, 0, path))
   332         if(SHGetFolderPathW(0, CSIDL_PERSONAL, NULL, 0, path) == S_OK)
   333         {
   333         {
   334             cfgdir->cd(path);
   334             cfgdir->cd(QString::fromWCharArray(path));
   335             checkForDir(cfgdir->absolutePath() + "/Hedgewars");
   335             checkForDir(cfgdir->absolutePath() + "/Hedgewars");
   336             cfgdir->cd("Hedgewars");
   336             cfgdir->cd("Hedgewars");
   337         }
   337         }
   338         else // couldn't retrieve documents folder? almost impossible, but in case fall back to classic path
   338         else // couldn't retrieve documents folder? almost impossible, but in case fall back to classic path
   339         {
   339         {