Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-12-05 17:32:48 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-12-05 17:32:48 +0400
commit68d39a262c9053000e56b3d8448f70284d9dba91 (patch)
treed7822b9bae6c76830c82ee3ec3a20a8461f9c0be /source/blender/windowmanager/intern/wm_files.c
parent4838a60b0c389292d701ec394b1204a168be7e21 (diff)
Fix T37688: User Preferences do not load correctly
Issue was caused by from_memory=true passing to wm_homefile_read in case there's a configuration folder for current blender. But the thing is, we still might fallback to reading home file from memory (i.e. in cases there's no startup.blend in config folder). In this case we still need to run versioning code for userprefs.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files.c')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 31af7804058..efbc0d78754 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -526,6 +526,17 @@ int wm_homefile_read(bContext *C, ReportList *reports, bool from_memory, const c
char prefstr[FILE_MAX];
int success = 0;
+ /* Indicates whether file was really load from memory.
+ *
+ * This is used for versioning code, and for this we can not rely on from_memory
+ * passed via argument. This is because there might be configuration folder
+ * exists but it might not have startup.blend and in this case we fallback to
+ * reading home file from memory.
+ *
+ * And in this case versioning code is to be run.
+ */
+ bool read_file_from_memory = false;
+
/* options exclude eachother */
BLI_assert((from_memory && custom_file) == 0);
@@ -578,6 +589,7 @@ int wm_homefile_read(bContext *C, ReportList *reports, bool from_memory, const c
}
if (success == 0) {
+ read_file_from_memory = true;
success = BKE_read_file_from_memory(C, datatoc_startup_blend, datatoc_startup_blend_size, NULL, true);
if (wmbase.first == NULL) wm_clear_default_size(C);
BLI_init_temporary_dir(U.tempdir);
@@ -600,7 +612,7 @@ int wm_homefile_read(bContext *C, ReportList *reports, bool from_memory, const c
G.fileflags &= ~G_FILE_RELATIVE_REMAP;
/* check userdef before open window, keymaps etc */
- wm_init_userdef(C, (bool)from_memory);
+ wm_init_userdef(C, read_file_from_memory);
/* match the read WM with current WM */
wm_window_match_do(C, &wmbase);