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

Geert Janssens janssens-geert at telenet.be
Mon Sep 24 15:21:23 EDT 2012


On 20-09-12 05:35, Mike Alexander wrote:
> --On September 19, 2012 9:13:27 PM +0200 Geert Janssens 
> <janssens-geert at telenet.be> wrote:
>
>> Well, I interpreted things wrongly. The user confirmed that file
>> loading still works with Mike's changes. So there's no need to do
>> some special casing. GOption is handling things perfectly fine. It
>> must have been some other change that came from the libgnome removal
>> that fixed the file loading issue. Since it works now, I have no
>> intention to look further.
>>
>
> I'm glad it works.  I wasn't looking forward to changing it again.  I 
> see that you also cleaned up my code a bit, which is fine.  It's 
> better with your changes.
>
Well, I figured that since I had to change gnucash-bin anyway to remove 
the libgnome dependency, why not remove some cruft that sneaked in over 
the years. Sometimes I'm surprised at how brittle some code can be. My 
small changes tripped up several other issues, like the one you fixed or 
the one Alexander discovered. I tend to find the result more 
straightforward and clean after all.
> Another thing that might be done is to move the command line parsing 
> back inside the gnucash_command_line function which is where it was 
> before the libgnome removal.  Either that or rename that function 
> since it doesn't really have much to do with command line parsing now.
>
I totally agree with this. So I have now moved the code back into 
gnucash_command_line. I left your comment on top of this function to 
remember our small gtk_init_with_args argument in the future.

  I did rename the function to be more in line with the other functions 
in GnuCash.  And additionally I chose to pass arguments exactly like 
gtk_init_with_args does (tripple dereference on argv) to minimize any 
potential changes that could break bug 626408 again.

Geert


More information about the gnucash-devel mailing list