[Bf-blender-cvs] [8d2a0d9b4cc] master: UI: Apply recent theme fixes for Preferences saved in 3.1 builds

Julian Eisel noreply at git.blender.org
Fri Nov 5 19:00:33 CET 2021


Commit: 8d2a0d9b4cc3d08e0b58bf5acd27388fc34ae639
Author: Julian Eisel
Date:   Fri Nov 5 18:46:00 2021 +0100
Branches: master
https://developer.blender.org/rB8d2a0d9b4cc3d08e0b58bf5acd27388fc34ae639

UI: Apply recent theme fixes for Preferences saved in 3.1 builds

Followup to e65230f0c03c.

Pablo and I decided it's fine to reset themes again when saved with the
recent 3.1 builds.

This needed to be done a bit careful, since a normal version patch
resetting the theme would've reset the theme for anybody opening
preferences of a 3.0 build (even the final release build) in a 3.1
build. So make sure the theme is at least from a 3.1 build (but not
newer then this commit of course).

===================================================================

M	source/blender/blenkernel/BKE_blender_version.h
M	source/blender/blenloader/intern/versioning_userdef.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h
index 6fc2fa37d9f..00934ef2002 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -39,7 +39,7 @@ extern "C" {
 
 /* Blender file format version. */
 #define BLENDER_FILE_VERSION BLENDER_VERSION
-#define BLENDER_FILE_SUBVERSION 0
+#define BLENDER_FILE_SUBVERSION 1
 
 /* Minimum Blender version that supports reading file written with the current
  * version. Older Blender versions will test this and show a warning if the file
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index 473a7e413ce..2d5d6479234 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -321,11 +321,16 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
     btheme->space_node.grid_levels = 7;
   }
 
-  if (!USER_VERSION_ATLEAST(300, 40)) {
+  if (!USER_VERSION_ATLEAST(300, 41)) {
     memcpy(btheme, &U_theme_default, sizeof(*btheme));
   }
 
-  if (!USER_VERSION_ATLEAST(300, 41)) {
+  /* Again reset the theme, but only if stored with an early 3.1 alpha version. Some changes were
+   * done in the release branch and then merged into the 3.1 branch (master). So the previous reset
+   * wouldn't work for people who saved their preferences with a 3.1 build meanwhile. But we still
+   * don't want to reset theme changes stored in the eventual 3.0 release once opened in a 3.1
+   * build. */
+  if (userdef->versionfile > 300 && !USER_VERSION_ATLEAST(301, 1)) {
     memcpy(btheme, &U_theme_default, sizeof(*btheme));
   }



More information about the Bf-blender-cvs mailing list