fixed not finding data dir if installed
authorConstantin Wenger <constantin.wenger@googlemail.com>
Wed, 10 Aug 2011 21:43:21 +0000 (23:43 +0200)
committerConstantin Wenger <constantin.wenger@googlemail.com>
Fri, 12 Aug 2011 12:26:37 +0000 (14:26 +0200)
src/constants.h
src/porting.cpp
src/porting.h

index 14ca58b433d5e13b45e620a81a1a933f24411494..21ab2a64c3b0097536b14e2aa2343ddf12b0b69b 100644 (file)
@@ -28,8 +28,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 //#define HAXMODE 0
 
-#define APPNAME "minetest"
-
 #define DEBUGFILE "debug.txt"
 
 #define WATER_ALPHA 160
index 3dd9b43c3c24b8be79856e24f72ffd546abbfd73..39b2c570587d2f083c2c9752935931321b43640d 100644 (file)
@@ -189,12 +189,12 @@ void initializePaths()
        
        // Use "./bin/../data"
        path_data = std::string(buf) + "/../data";
-       //path_data = std::string(buf) + "/../share/" + APPNAME;
+       //path_data = std::string(buf) + "/../share/" + PROJECT_NAME;
                
-       // Use "C:\Documents and Settings\user\Application Data\<APPNAME>"
+       // Use "C:\Documents and Settings\user\Application Data\<PROJECT_NAME>"
        len = GetEnvironmentVariable("APPDATA", buf, buflen);
        assert(len < buflen);
-       path_userdata = std::string(buf) + "/" + APPNAME;
+       path_userdata = std::string(buf) + "/" + PROJECT_NAME;
 
        /*
                Linux
@@ -209,15 +209,15 @@ void initializePaths()
        
        pathRemoveFile(buf, '/');
 
-       path_data = std::string(buf) + "/../share/" + APPNAME;
-       //path_data = std::string(INSTALL_PREFIX) + "/share/" + APPNAME;
+       path_data = std::string(buf) + "/../share/" + PROJECT_NAME;
+       //path_data = std::string(INSTALL_PREFIX) + "/share/" + PROJECT_NAME;
        if (!fs::PathExists(path_data)) {
                dstream<<"WARNING: data path " << path_data << " not found!";
                path_data = std::string(buf) + "/../data";
                dstream<<" Trying " << path_data << std::endl;
        }
        
-       path_userdata = std::string(getenv("HOME")) + "/." + APPNAME;
+       path_userdata = std::string(getenv("HOME")) + "/." + PROJECT_NAME;
 
        /*
                OS X
@@ -243,12 +243,12 @@ void initializePaths()
     }
     CFRelease(resources_url);
        
-       path_userdata = std::string(getenv("HOME")) + "/Library/Application Support/" + APPNAME;
+       path_userdata = std::string(getenv("HOME")) + "/Library/Application Support/" + PROJECT_NAME;
 
        #elif defined(__FreeBSD__)
 
-       path_data = std::string(INSTALL_PREFIX) + "/share/" + APPNAME;
-       path_userdata = std::string(getenv("HOME")) + "/." + APPNAME;
+       path_data = std::string(INSTALL_PREFIX) + "/share/" + PROJECT_NAME;
+       path_userdata = std::string(getenv("HOME")) + "/." + PROJECT_NAME;
     
        #endif
 
index 3cf8df594b82d66f5710c6c24c50317d29cf914d..3f9486b63fb1fda9b14afafe5e8e2347e99f17a1 100644 (file)
@@ -63,9 +63,9 @@ extern std::string path_data;
 
 /*
        Directory for storing user data. Examples:
-       Windows: "C:\Documents and Settings\user\Application Data\<APPNAME>"
-       Linux: "~/.<APPNAME>"
-       Mac: "~/Library/Application Support/<APPNAME>"
+       Windows: "C:\Documents and Settings\user\Application Data\<PROJECT_NAME>"
+       Linux: "~/.<PROJECT_NAME>"
+       Mac: "~/Library/Application Support/<PROJECT_NAME>"
 */
 extern std::string path_userdata;