[Tux4kids-commits] r1648 - tuxtype/trunk/src

Matthew Trey treymd-guest at alioth.debian.org
Sat Nov 14 13:28:44 UTC 2009


Author: treymd-guest
Date: 2009-11-14 13:28:44 +0000 (Sat, 14 Nov 2009)
New Revision: 1648

Modified:
   tuxtype/trunk/src/setup.c
Log:
Windows: Moved the user settings file to the user profile directory, so each user can have their own settings

Modified: tuxtype/trunk/src/setup.c
===================================================================
--- tuxtype/trunk/src/setup.c	2009-11-14 12:25:30 UTC (rev 1647)
+++ tuxtype/trunk/src/setup.c	2009-11-14 13:28:44 UTC (rev 1648)
@@ -183,7 +183,9 @@
   /* set the settings directory/file */
 
 #ifdef WIN32
-  snprintf(fn, FNLEN - 1, "userdata/settings.txt");
+  // MDTTEMP: commented out the next line and added the line after
+  // snprintf(fn, FNLEN - 1, "userdata/settings.txt");
+  snprintf( fn, FNLEN-1, "%s/TuxType/settings.txt", getenv("APPDATA"));
   LOG("WIN32 defined\n");
 #else
   snprintf(fn, FNLEN - 1, (const char*)"%s/.tuxtype/settings.txt", getenv("HOME"));
@@ -326,8 +328,13 @@
 	/* set the settings directory/file */
 
 	#ifdef WIN32
-		_mkdir( "userdata" );  // just in case try to create save location
-		snprintf( fn, FNLEN-1, "userdata/settings.txt" );
+        //MDTTEMP: Commented out the next line and added the next 2 lines after
+		//_mkdir( "userdata" );  // just in case try to create save location
+		snprintf( fn, FNLEN-1, (const char*)"%s/TuxType", getenv("APPDATA") );
+		_mkdir( fn );  // just in case try to create save location
+        // MDTTEMP: Commented out the next line and added the line after
+		//snprintf( fn, FNLEN-1, "userdata/settings.txt" );
+		snprintf( fn, FNLEN-1, "%s/TuxType/settings.txt", getenv("APPDATA"));
 	#else
 		snprintf( fn, FNLEN-1, (const char*)"%s/.tuxtype", getenv("HOME") );
 		mkdir( fn, 0755 ); // just in case try to create save location




More information about the Tux4kids-commits mailing list