Skip to content

Commit

Permalink
On a new install, the gnc_gsettings_version_upgrade
Browse files Browse the repository at this point in the history
 would not run

When doing a new install, set the GNC_PREF_VERSION to the current
version.
  • Loading branch information
Bob-IT committed Feb 17, 2023
1 parent 57f874b commit 2306ef8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libgnucash/app-utils/gnc-gsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -870,9 +870,12 @@ void gnc_gsettings_version_upgrade (void)
auto ogG_maj_min = gnc_gsettings_get_user_value (GNC_PREFS_GROUP_GENERAL, GNC_PREF_VERSION);
auto og_maj_min = gnc_gsettings_get_user_value (GSET_SCHEMA_OLD_PREFIX "." GNC_PREFS_GROUP_GENERAL, GNC_PREF_VERSION);

auto cur_maj_min = PROJECT_VERSION_MAJOR * 1000 + PROJECT_VERSION_MINOR;

if (!ogG_maj_min && !og_maj_min) // new install
{
LEAVE("");
gnc_gsettings_set_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_VERSION, cur_maj_min);
LEAVE ("Setting Previous compatibility level to current version: %i", cur_maj_min);
return;
}

Expand All @@ -887,8 +890,6 @@ void gnc_gsettings_version_upgrade (void)
if (og_maj_min)
g_variant_unref (og_maj_min);

auto cur_maj_min = PROJECT_VERSION_MAJOR * 1000 + PROJECT_VERSION_MINOR;

PINFO ("Previous setting compatibility level: %i, Current version: %i", old_maj_min, cur_maj_min);

transform_settings (old_maj_min, cur_maj_min);
Expand Down

0 comments on commit 2306ef8

Please sign in to comment.