[Gnucash-changes] r13358 - gnucash/trunk/src - No need to run the BOOK_OPENED hook twice when open a book.

Chris Shoemaker chris at cvs.gnucash.org
Tue Feb 21 22:30:49 EST 2006


Author: chris
Date: 2006-02-21 22:30:48 -0500 (Tue, 21 Feb 2006)
New Revision: 13358
Trac: http://svn.gnucash.org/trac/changeset/13358

Modified:
   gnucash/trunk/src/bin/gnucash-bin.c
   gnucash/trunk/src/gnome-utils/gnc-file.c
Log:
   No need to run the BOOK_OPENED hook twice when open a book.
   And no need to run it at all when we fail to open a book.
   Also, require HAVE_GTK26 before using gtk_get_option_group().


Modified: gnucash/trunk/src/bin/gnucash-bin.c
===================================================================
--- gnucash/trunk/src/bin/gnucash-bin.c	2006-02-22 03:05:20 UTC (rev 13357)
+++ gnucash/trunk/src/bin/gnucash-bin.c	2006-02-22 03:30:48 UTC (rev 13358)
@@ -108,7 +108,7 @@
 
 static gboolean
 try_load(gchar *fn)
-{    
+{
     g_message("looking for %s", fn);
     if (g_file_test(fn, G_FILE_TEST_EXISTS)) {
         g_message("trying to load %s", fn);
@@ -209,7 +209,7 @@
     char *p;
     int debugging = 0;
     char *namespace_regexp = NULL;
-#ifndef HAVE_GLIB26
+#ifndef HAVE_GTK26
     poptContext pc;
     int rc;
     struct poptOption options[] = {
@@ -457,8 +457,7 @@
     if (!nofile && (fn = get_file_to_load())) {
         gnc_update_splash_screen(_("Loading data..."));
         gnc_destroy_splash_screen();
-        if (gnc_file_open_file(fn))
-            gnc_hook_run(HOOK_BOOK_OPENED, NULL);
+        gnc_file_open_file(fn);
         g_free(fn);
     } 
     else if (gnc_gconf_get_bool("dialogs/new_user", "first_startup", &error) &&

Modified: gnucash/trunk/src/gnome-utils/gnc-file.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-file.c	2006-02-22 03:05:20 UTC (rev 13357)
+++ gnucash/trunk/src/gnome-utils/gnc-file.c	2006-02-22 03:30:48 UTC (rev 13358)
@@ -777,10 +777,6 @@
     gnc_engine_resume_events ();
     gnc_gui_refresh_all ();
 
-    /* CAS: This doesn't seem right.  We failed. */
-    /* Call this after re-enabling events. */
-    gnc_book_opened ();
-
     return FALSE;
   }
 



More information about the gnucash-changes mailing list