}
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
+#if GDEF_OS_MACOS
+ /* This is used on macOS, this will produce
+ ~/Library/Application Support/NetRadiant folder. */
+ home << DirectoryCleaned( g_get_home_dir() );
+ Q_mkdir( home.c_str() );
+ home << "Library/";
+ Q_mkdir( home.c_str() );
+ home << "Application Support/";
+ Q_mkdir( home.c_str() );
+ home << RADIANT_NAME << "/";
+#else // if GDEF_OS_XDG
+ /* This is used on both Linux and FreeBSD,
+ this will produce ~/.config/netradiant folder
+ when environment has default settings, the
+ XDG_CONFIG_HOME variable modifies it. */
+ home << DirectoryCleaned( g_get_user_config_dir() );
+ Q_mkdir( home.c_str() );
+ home << RADIANT_BASENAME << "/";
+#endif // ! GDEF_OS_MACOS
Q_mkdir( home.c_str() );
home_path = home.c_str();
}
+
gamedetect();
}