GSettings - run data model transations while setting up

This makes sure all schema changes are in effect before
the first consumer can query them. For example this will
prevent a one-time re-occurrence of the tip of the day dialog
the first time the new migrations are run.
This commit is contained in:
Geert Janssens 2021-09-22 15:44:30 +02:00
parent e1039b2dba
commit 8ea52ae212
2 changed files with 4 additions and 3 deletions

View File

@ -145,9 +145,6 @@ scm_run_gnucash (void *data, [[maybe_unused]] int argc, [[maybe_unused]] char **
scm_set_current_module(main_mod);
scm_c_use_module("gnucash app-utils");
/* Check whether the settings need a version update */
gnc_gsettings_version_upgrade ();
gnc_gnome_utils_init();
gnc_search_core_initialize ();
gnc_hook_add_dangler(HOOK_UI_SHUTDOWN, (GFunc)gnc_search_core_finalize, NULL, NULL);

View File

@ -627,6 +627,10 @@ void gnc_gsettings_load_backend (void)
prefsbackend->block_all = gnc_gsettings_block_all;
prefsbackend->unblock_all = gnc_gsettings_unblock_all;
/* Run any data model changes for the backend before it's used
* by anyone */
gnc_gsettings_version_upgrade();
LEAVE("Prefsbackend bind = %p", prefsbackend->bind);
}