[Gnucash-changes] r11969 - gnucash/trunk/src/gnome - Allow engine to provide default budget instead of getting it in the GUI.

Chris Shoemaker chris at cvs.gnucash.org
Thu Nov 17 23:20:58 EST 2005


Author: chris
Date: 2005-11-17 23:20:57 -0500 (Thu, 17 Nov 2005)
New Revision: 11969
Trac: http://svn.gnucash.org/trac/changeset/11969

Modified:
   gnucash/trunk/src/gnome/gnc-plugin-budget.c
Log:
Allow engine to provide default budget instead of getting it in the GUI.

Modified: gnucash/trunk/src/gnome/gnc-plugin-budget.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-budget.c	2005-11-17 15:19:14 UTC (rev 11968)
+++ gnucash/trunk/src/gnome/gnc-plugin-budget.c	2005-11-18 04:20:57 UTC (rev 11969)
@@ -171,12 +171,6 @@
     gnc_main_window_open_page (data->window, page);
 }
 
-static void just_get_one(QofEntity *ent, gpointer data)
-{
-    GncBudget **bgt = (GncBudget**)data;
-    if (bgt && !*bgt) *bgt = GNC_BUDGET(ent);
-}
-
 /* If only one budget exists, open it; otherwise user selects one to open */
 static void
 gnc_plugin_budget_cmd_open_budget (GtkAction *action,
@@ -193,7 +187,7 @@
     count = qof_collection_count(col);
     if (count > 0) {
         if (count == 1) {
-            qof_collection_foreach(col, just_get_one, &bgt);
+            bgt = gnc_budget_get_default(book);
         } else {
             bgt = gnc_budget_gui_select_budget(book);
         }



More information about the gnucash-changes mailing list