[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60594] trunk/blender/intern/ghost/intern/ GHOST_SystemPathsX11.cpp: Fix regression in r59316

Sergey Sharybin sergey.vfx at gmail.com
Mon Oct 7 18:06:15 CEST 2013


Revision: 60594
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60594
Author:   nazgul
Date:     2013-10-07 16:06:15 +0000 (Mon, 07 Oct 2013)
Log Message:
-----------
Fix regression in r59316

Different version could be passed here, added check
cached path is calculated with the proper one.

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59316

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_SystemPathsX11.cpp

Modified: trunk/blender/intern/ghost/intern/GHOST_SystemPathsX11.cpp
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemPathsX11.cpp	2013-10-07 15:30:08 UTC (rev 60593)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemPathsX11.cpp	2013-10-07 16:06:15 UTC (rev 60594)
@@ -74,13 +74,16 @@
 const GHOST_TUns8 *GHOST_SystemPathsX11::getUserDir(int version, const char *versionstr) const
 {
 	static string user_path = "";
+	static int last_version = 0;
 
 	/* in blender 2.64, we migrate to XDG. to ensure the copy previous settings
 	 * operator works we give a different path depending on the requested version */
 	if (version < 264) {
-		if (user_path.empty()) {
+		if (user_path.empty() || last_version != version) {
 			const char *home = getenv("HOME");
 
+			last_version = version;
+
 			if (home) {
 				user_path = string(home) + "/.blender/" + versionstr;
 			}
@@ -91,9 +94,11 @@
 		return (GHOST_TUns8 *)user_path.c_str();
 	}
 	else {
-		if (user_path.empty()) {
+		if (user_path.empty() || last_version != version) {
 			const char *home = getenv("XDG_CONFIG_HOME");
 
+			last_version = version;
+
 			if (home) {
 				user_path = string(home) + "/blender/" + versionstr;
 			}




More information about the Bf-blender-cvs mailing list