]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/environment.cpp
bikeshedding: comment wording
[xonotic/netradiant.git] / radiant / environment.cpp
index b38ef992a59a84654e54bb0d4936b9d37346f585..29a86226af3f4e211b7417d9a69b0c0ffc80e5e3 100644 (file)
@@ -139,8 +139,10 @@ void gamedetect(){
                        if ( gamedetect_check_game( "nexuiz.game", "data/common-spog.pk3", "nexuiz.exe", buf, p - buf ) )
 #elif GDEF_OS_MACOS
                        if ( gamedetect_check_game( "nexuiz.game", "data/common-spog.pk3", "Nexuiz.app/Contents/Info.plist", buf, p - buf ) )
-#else
+#elif GDEF_OS_LINUX
                        if ( gamedetect_check_game( "nexuiz.game", "data/common-spog.pk3", "nexuiz-linux-glx.sh", buf, p - buf ) )
+#else
+                       if ( gamedetect_check_game( "nexuiz.game", "data/common-spog.pk3", NULL, buf, p - buf ) )
 #endif
                        { return; }
 
@@ -165,8 +167,8 @@ void gamedetect(){
 
 namespace
 {
-CopiedString home_path;
-CopiedString app_path;
+       CopiedString home_path;
+       CopiedString app_path;
        CopiedString lib_path;
        CopiedString data_path;
 }
@@ -211,7 +213,7 @@ bool portable_app_setup(){
 const char* LINK_NAME =
 #if GDEF_OS_LINUX
        "/proc/self/exe"
-#else // FreeBSD and OSX
+#else // FreeBSD and macOS
        "/proc/curproc/file"
 #endif
 ;
@@ -287,8 +289,14 @@ void environment_init( int argc, char const* argv[] ){
        }
 
        if ( !portable_app_setup() ) {
+               // this is used on both Linux and macOS
+               // but a macOS specific code may be written instead
                StringOutputStream home( 256 );
                home << DirectoryCleaned(g_get_user_config_dir()) << "/" << RADIANT_BASENAME << "/";
+               // first create ~/.config
+               // since it may be missing on brand new home directory
+               Q_mkdir( g_get_user_config_dir() );
+               // then create ~/.config/netradiant
                Q_mkdir( home.c_str() );
                home_path = home.c_str();
        }