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
This commit is contained in:
Harley Acheson 2023-04-05 22:35:05 +02:00
parent 8f8548e964
commit 302e858273

@ -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);