r22831 - gnucash/trunk/src/bin - One more try to get initialization right.

Mike Alexander mta at code.gnucash.org
Sat Mar 23 02:41:10 EDT 2013


Author: mta
Date: 2013-03-23 02:41:09 -0400 (Sat, 23 Mar 2013)
New Revision: 22831
Trac: http://svn.gnucash.org/trac/changeset/22831

Modified:
   gnucash/trunk/src/bin/gnucash-bin.c
Log:
One more try to get initialization right.
This doesn't change things unless --add-price-quotes is given.  If it is then it must be
handled before gtk is initialized since DISPLAY might not be set which will cause gtk
initialization to fail.  This happens when running the X version of GnuCash from launchd
on a Mac to get price quotes updated.

Modified: gnucash/trunk/src/bin/gnucash-bin.c
===================================================================
--- gnucash/trunk/src/bin/gnucash-bin.c	2013-03-22 21:40:01 UTC (rev 22830)
+++ gnucash/trunk/src/bin/gnucash-bin.c	2013-03-23 06:41:09 UTC (rev 22831)
@@ -860,6 +860,15 @@
 
     gnc_log_init();
 
+    /* If asked via a command line parameter, fetch quotes only */
+    if (add_quotes_file)
+    {
+        /* First initialize the module system, even though gtk hasn't been initialized. */
+        gnc_module_system_init();
+        scm_boot_guile(argc, argv, inner_main_add_price_quotes, 0);
+        exit(0);  /* never reached */
+    }
+
     /* We need to initialize gtk before looking up all modules */
     gnc_gtk_add_rc_file ();
     if(!gtk_init_check (&argc, &argv))
@@ -874,13 +883,6 @@
     initialization to be run, hence gtk must be initialized beforehand. */
     gnc_module_system_init();
 
-    /* If asked via a command line parameter, fetch quotes only */
-    if (add_quotes_file)
-    {
-        scm_boot_guile(argc, argv, inner_main_add_price_quotes, 0);
-        exit(0);  /* never reached */
-    }
-
     gnc_gui_init();
     scm_boot_guile(argc, argv, inner_main, 0);
     exit(0); /* never reached */



More information about the gnucash-changes mailing list