r22398 - gnucash/trunk/src/bin - Parse arguments before initializing GTK so --add-price-quotes works
Geert Janssens
janssens-geert at telenet.be
Tue Sep 18 04:42:38 EDT 2012
On 17-09-12 03:10, Mike Alexander wrote:
> Author: mta
> Date: 2012-09-16 21:09:59 -0400 (Sun, 16 Sep 2012)
> New Revision: 22398
> Trac: http://svn.gnucash.org/trac/changeset/22398
>
> Modified:
> gnucash/trunk/src/bin/gnucash-bin.c
> Log:
> Parse arguments before initializing GTK so --add-price-quotes works
> when the GUI can't be initialized. gtk_init_with_args fails before
> parsing the arguments if the GUI can't be initialized.
That's an unfortunate design decision in gtk_init_with args.
Using plain g_option_context_parse has one potential problem though:
there is a risk that your patch will break file loading again on Windows
systems that are not UTF-8 (like Korean). There was a long-standing bug
[1] that was fixed by letting gtk_init (and friends) parse the command
line in this respect.
I have asked the original reporter to test the latest nightly to verify
this. If it breaks again, we probably should have gtk_init_with_args
attempt to parse the args by default. If it fails, only then fall back
to plain g_option_context_parse.
Geert
[1] https://bugzilla.gnome.org/show_bug.cgi?id=626408
More information about the gnucash-devel
mailing list