]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/environment.cpp
Suppress warnings
[xonotic/netradiant.git] / radiant / environment.cpp
index 9583b90fbc3761fff1e41f25be173f376aec0401..a28524e6d8e10baf17014ba5df4b1e9371cf9baa 100644 (file)
@@ -30,9 +30,9 @@
 #include "cmdlib.h"
 
 int g_argc;
-char** g_argv;
+char const** g_argv;
 
-void args_init( int argc, char* argv[] ){
+void args_init( int argc, char const* argv[] ){
        int i, j, k;
 
        for ( i = 1; i < argc; i++ )
@@ -54,8 +54,8 @@ void args_init( int argc, char* argv[] ){
        g_argv = argv;
 }
 
-char *gamedetect_argv_buffer[1024];
-void gamedetect_found_game( char *game, char *path ){
+char const *gamedetect_argv_buffer[1024];
+void gamedetect_found_game( char const *game, char *path ){
        int argc;
        static char buf[128];
 
@@ -79,7 +79,7 @@ void gamedetect_found_game( char *game, char *path ){
        g_argv = gamedetect_argv_buffer;
 }
 
-bool gamedetect_check_game( char *gamefile, const char *checkfile1, const char *checkfile2, char *buf /* must have 64 bytes free after bufpos */, int bufpos ){
+bool gamedetect_check_game( char const *gamefile, const char *checkfile1, const char *checkfile2, char *buf /* must have 64 bytes free after bufpos */, int bufpos ){
        buf[bufpos] = '/';
 
        strcpy( buf + bufpos + 1, checkfile1 );
@@ -136,8 +136,8 @@ void gamedetect(){
 #endif
                        { return; }
 
-                       // try to detect Q2World installs
-                       if ( gamedetect_check_game( "q2w.game", "default/quake2world.version", NULL, buf, p - buf ) ) {
+                       // try to detect Quetoo installs
+                       if ( gamedetect_check_game( "quetoo.game", "default/icons/quetoo.png", NULL, buf, p - buf ) ) {
                                return;
                        }
 
@@ -196,7 +196,7 @@ const char* LINK_NAME =
 ;
 
 /// brief Returns the filename of the executable belonging to the current process, or 0 if not found.
-char* getexename( char *buf ){
+char const* getexename( char *buf ){
        /* Now read the symbolic link */
        int ret = readlink( LINK_NAME, buf, PATH_MAX );
 
@@ -224,7 +224,7 @@ char* getexename( char *buf ){
        return buf;
 }
 
-void environment_init( int argc, char* argv[] ){
+void environment_init( int argc, char const* argv[] ){
        // Give away unnecessary root privileges.
        // Important: must be done before calling gtk_init().
        char *loginname;
@@ -245,7 +245,7 @@ void environment_init( int argc, char* argv[] ){
 
        if ( !portable_app_setup() ) {
                StringOutputStream home( 256 );
-               home << DirectoryCleaned( g_get_home_dir() ) << ".netradiant/";
+               home << DirectoryCleaned( g_get_user_config_dir() ) << "netradiant/";
                Q_mkdir( home.c_str() );
                home_path = home.c_str();
        }