From d867cefa32ca3b26bbfc279e2f04d4f795dc13a4 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sat, 13 Apr 2013 12:03:20 +0000 Subject: Bug fix #34896 The feature "Keep Session" was also loading that session when you double-click on a .blend to open it, or when a .blend file was on commandline. Moved this feature to the main() in creator.c, so it can check on it properly, skipping the kept session when a file was loaded. --- source/creator/creator.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/creator') diff --git a/source/creator/creator.c b/source/creator/creator.c index cea32a8b171..aecff4c9e03 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -1196,6 +1196,11 @@ static int set_addons(int argc, const char **argv, void *data) } } +static int test_file(int UNUSED(argc), const char **argv, void *data) +{ + printf("path is %s\n", argv[0]); +} + static int load_file(int UNUSED(argc), const char **argv, void *data) { bContext *C = data; @@ -1604,6 +1609,13 @@ int main(int argc, const char **argv) /* OK we are ready for it */ #ifndef WITH_PYTHON_MODULE BLI_argsParse(ba, 4, load_file, C); + + if (G.background == 0) { + if (!G.file_loaded) + if (U.uiflag2 & USER_KEEP_SESSION) + WM_recover_last_session(C, NULL); + } + #endif #ifndef WITH_PYTHON_MODULE -- cgit v1.2.3