From 302e8582738381ffc9ed5da279894819c74dbb5c Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Wed, 5 Apr 2023 22:35:05 +0200 Subject: [PATCH] Fix #104507: Show Splash if New Version Show Splash screen if there are no Preferences found even if we are launched with a filename, so that users can migrate old settings. Pull Request: https://projects.blender.org/blender/blender/pulls/105863 --- source/creator/creator.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source/creator/creator.c b/source/creator/creator.c index 6d55cb57b1b..0e42c896fde 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -24,6 +24,8 @@ #include "DNA_genfile.h" +#include "BLI_fileops.h" +#include "BLI_path_util.h" #include "BLI_string.h" #include "BLI_system.h" #include "BLI_task.h" @@ -577,9 +579,16 @@ int main(int argc, WM_exit(C); } else { - /* When no file is loaded, show the splash screen. */ + /* When no file is loaded or if there is no userprefs, show the splash screen. */ const char *blendfile_path = BKE_main_blendfile_path_from_global(); - if (blendfile_path[0] == '\0') { + + char userpref[FILE_MAX] = {0}; + const char *const cfgdir = BKE_appdir_folder_id(BLENDER_USER_CONFIG, NULL); + if (cfgdir) { + BLI_path_join(userpref, sizeof(userpref), cfgdir, BLENDER_USERPREF_FILE); + } + + if (blendfile_path[0] == '\0' || !BLI_exists(userpref)) { WM_init_splash(C); } WM_main(C);