Re: [GNC-dev] Preferences for Accounting Period start-date and end-date lost on 4.9 Install

"Chris Good" <[email protected]>
Newsgroups gmane.comp.gnome.apps.gnucash.devel
Message-ID <[email protected]>
-----Original Message-----
From: john <[email protected]> 
Sent: Monday, 3 January 2022 11:40 AM
To: Chris Good <[email protected]>
Cc: [email protected]
Subject: Re: [GNC-dev] Preferences for Accounting Period start-date and
end-date lost on 4.9 Install

> On Jan 2, 2022, at 4:25 PM, Chris Good <[email protected]> wrote:
> 
> Hi All,
> 
> I installed Gnucash 4.9 on my Windows 10 machine (was 4.4) and the 
> Preferences for Accounting Period start-date and end-date were lost.
> 
> They have gone back to the default 1/1/1970.
> 
> Looking in the registry I can see they have been migrated (moved) from
> HKCU\Software\GSettings\org\gnucash\window\pages\account-tree\summary\
> [start -date etc]
> 
>  To
> 
> HKCU\Software\GSettings\org\gnucash\GnuCash\window\pages\account-tree\
> summary
> 
> but the Preference dialog and the Accounts page still seem to be 
> looking at the old keys.
> 
> I set them again using the preferences dialog and now they are in both 
> the old and new locations.
> 
> After View, Refresh the Accounts page is showing the correct 
> Total(Period) figures again.
> 
> If it makes any difference, the first time I opened 4.9 it was with 
> the --nofile arg.
> 
> Should the old or new schema location be used?
> 
> HKCU\Software\GSettings\org\gnucash\general\prefs-version         = 404
> HKCU\Software\GSettings\org\gnucash\GnuCash\general\prefs-version = 
> 4009

The new schema is correct for GnuCash 4.7 and later.

Regards,
John Ralls

Hi John,

I put the registry back to how it was before I ran 4.9 (my BackupGnuCash
utility saves
the state of the Registry) and started 4.9 with args
--debug --log gnc.pref=debug --log gnc.app-utils.gsettings=debug
(no --nofile this time).

This did something different to last time. Now the old path
HKCU\Software\GSettings\org\gnucash\window\pages\account-tree\summary
 is still correct and the new path
HKCU\Software\GSettings\org\gnucash\GnuCash\window\pages\account-tree\summar
y
exists but is empty.

The tracefile shows lots of subscribe warnings in the preferences migration
and also afterwards:

* 18:14:11  INFO <gnc.app-utils.gsettings>         [migrate_one_key]
Migrating 'org.gnucash.dialogs.import.csv:last-geometry' to
'org.gnucash.GnuCash.dialogs.import.csv:last-geometry'
* 18:14:11 DEBUG <gnc.app-utils.gsettings>         [enter
C:/gcdev64/gnucash/releases/src/gnucash-4.9/libgnucash/app-utils/gnc-gsettin
gs.cpp:gnc_gsettings_get_settings_ptr()] 
* 18:14:11 DEBUG <gnc.app-utils.gsettings>
[gnc_gsettings_get_settings_ptr] Looking for schema
org.gnucash.dialogs.import.csv returned gsettings 00000000
* 18:14:11  WARN <GLib-GIO>             subscribe() failed: only 64
different paths may be watched.

It seems this is from:
https://gitlab.gnome.org/GNOME/glib/-/blob/main/gio/gregistrysettingsbackend
.c
Because we have to cache every registry value locally, reads are done
 *     from the cache rather than directly from the registry. Writes update
 *     both. This means that the backend will not work if the watch thread
is
 *     not running. A GSettings object always subscribes to changes so we
can
 *     be sure that the watch thread will be running, but if for some reason
 *     the backend is being used directly you should bear that in mind.

/* Testing (on Windows XP SP3) shows that WaitForMultipleObjects fails with
 * "The parameter is incorrect" after 64 watches. We need one for the
 * message_sent cond, which is allowed for in the way the watches_remaining
 * variable is used.
 */
#define MAX_WATCHES   64

g_registry_backend_subscribe()
  if (g_atomic_int_dec_and_test (&self->watch->watches_remaining))
    {
      g_atomic_int_inc (&self->watch->watches_remaining);
      g_warning ("subscribe() failed: only %i different paths may be
watched.", MAX_WATCHES);
      return;
    }

I've no idea why g_registry_backend_subscribe() is being called.
Perhaps it is for every GSettings object so the warning thread can monitor
changes?
I cannot find anything in the GSettings doco about a 64 limit on
subscriptions.

Anybody have any ideas about what in GnuCash is causing these errors in
Windows?
I haven't seen any of these subscribe warnings in my Linux system.

I may try to setup a Windows build environment so I can get a stack trace
when I get some time.
Do you have to pay for anything to do this for Windows?

Regards, Chris Good
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.