r22398 - gnucash/trunk/src/bin - Parse arguments before initializing GTK so --add-price-quotes works

John Ralls jralls at ceridwen.us
Tue Sep 18 09:54:12 EDT 2012


On Sep 18, 2012, at 1:42 AM, Geert Janssens <janssens-geert at telenet.be> wrote:

> 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.
> 

Why unfortunate? It's gtk_init, after all, and in the case of add-price-quotes we don't even *want* to init gtk. If gtk_init_with_args is processing the command-line (including file paths) better than GOption then *that's* the design problem: Gtk shouldn't be duplicating GLib functionality, and GLib should be able to handle all supported systems.

Which begs the question of why Microsoft isn't using Unicode to handle Hangul, but that's not something that we can fix in Gtk or Gnucash.

Regards,
John Ralls





More information about the gnucash-devel mailing list