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:
authorXiao Xiangquan <xiaoxiangquan@gmail.com>2011-07-22 18:14:28 +0400
committerXiao Xiangquan <xiaoxiangquan@gmail.com>2011-07-22 18:14:28 +0400
commit08645d92933c35b936e555ee7fec3f0dce2ad1bf (patch)
tree55eb33e24213a5317922bcfd8f3ab6cb72c6529b /source/blender/windowmanager/intern/wm_files.c
parent77926a7f9d7c8f07bc4aa70c48ade0f7927836b4 (diff)
switch language in User Preference's System page. with some known switch failure bugs
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files.c')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index df00c2b83cb..d69aa8c1c4c 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -444,9 +444,8 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports)
/* called on startup, (context entirely filled with NULLs) */
/* or called for 'New File' */
/* op can be NULL */
-int WM_read_homefile(bContext *C, ReportList *reports, short from_memory)
+int WM_read_homefile(bContext *C, ReportList *reports, short from_memory, ListBase *wmbase)
{
- ListBase wmbase;
char tstr[FILE_MAXDIR+FILE_MAXFILE];
int success= 0;
@@ -468,7 +467,7 @@ int WM_read_homefile(bContext *C, ReportList *reports, short from_memory)
G.fileflags &= ~G_FILE_NO_UI;
/* put aside screens to match with persistant windows later */
- wm_window_match_init(C, &wmbase);
+ wm_window_match_init(C, wmbase);
if (!from_memory && BLI_exists(tstr)) {
success = (BKE_read_file(C, tstr, NULL) != BKE_READ_FILE_FAIL);
@@ -480,7 +479,7 @@ int WM_read_homefile(bContext *C, ReportList *reports, short from_memory)
}
if(success==0) {
success = BKE_read_file_from_memory(C, datatoc_startup_blend, datatoc_startup_blend_size, NULL);
- if (wmbase.first == NULL) wm_clear_default_size(C);
+ if (wmbase->first == NULL) wm_clear_default_size(C);
#ifdef WITH_PYTHON_SECURITY /* not default */
/* use alternative setting for security nuts
@@ -488,7 +487,12 @@ int WM_read_homefile(bContext *C, ReportList *reports, short from_memory)
U.flag |= USER_SCRIPT_AUTOEXEC_DISABLE;
#endif
}
-
+ return TRUE;
+}
+
+/* split from the old WM_read_homefile */
+int WM_read_homefile_proc(bContext *C, ListBase *wmbase)
+{
/* prevent buggy files that had G_FILE_RELATIVE_REMAP written out by mistake. Screws up autosaves otherwise
* can remove this eventually, only in a 2.53 and older, now its not written */
G.fileflags &= ~G_FILE_RELATIVE_REMAP;
@@ -497,7 +501,7 @@ int WM_read_homefile(bContext *C, ReportList *reports, short from_memory)
wm_init_userdef(C);
/* match the read WM with current WM */
- wm_window_match_do(C, &wmbase);
+ wm_window_match_do(C, wmbase);
WM_check(C); /* opens window(s), checks keymaps */
G.main->name[0]= '\0';
@@ -542,8 +546,9 @@ int WM_read_homefile(bContext *C, ReportList *reports, short from_memory)
int WM_read_homefile_exec(bContext *C, wmOperator *op)
{
+ ListBase wmbase;
int from_memory= strcmp(op->type->idname, "WM_OT_read_factory_settings") == 0;
- return WM_read_homefile(C, op->reports, from_memory) ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
+ return WM_read_homefile(C, op->reports, from_memory, &wmbase) && WM_read_homefile_proc(C, &wmbase) ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
}
void WM_read_history(void)