r15831 - gnucash/trunk/src/gnome - remove a level of (legacy) indirection around some calls.

Josh Sled jsled at cvs.gnucash.org
Thu Apr 5 20:50:50 EDT 2007


Author: jsled
Date: 2007-04-05 20:50:50 -0400 (Thu, 05 Apr 2007)
New Revision: 15831
Trac: http://svn.gnucash.org/trac/changeset/15831

Modified:
   gnucash/trunk/src/gnome/dialog-sx-since-last-run.c
Log:
remove a level of (legacy) indirection around some calls.

Modified: gnucash/trunk/src/gnome/dialog-sx-since-last-run.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-sx-since-last-run.c	2007-04-06 00:50:13 UTC (rev 15830)
+++ gnucash/trunk/src/gnome/dialog-sx-since-last-run.c	2007-04-06 00:50:50 UTC (rev 15831)
@@ -92,8 +92,6 @@
 /** @return false if the iter is not actaully an GncSxInstance's variable. **/
 gboolean gnc_sx_slr_model_get_instance_and_variable(GncSxSlrTreeModelAdapter *model, GtkTreeIter *iter, GncSxInstance **instance_loc, GncSxVariable **var_loc);
 
-void gnc_sx_slr_model_change_instance_state(GncSxSlrTreeModelAdapter *model, GncSxInstance *instance, GncSxInstanceState new_state);
-void gnc_sx_slr_model_change_variable(GncSxSlrTreeModelAdapter *model, GncSxInstance *instance, GncSxVariable *variable, gnc_numeric *new_value);
 void gnc_sx_slr_model_effect_change(GncSxSlrTreeModelAdapter *model, gboolean auto_create_only, GList **created_transaction_guids, GList **creation_errors);
 
 GtkTreeModel* gnc_sx_get_slr_state_model(void);
@@ -661,13 +659,6 @@
     return TRUE;
 }
 
-void
-gnc_sx_slr_model_change_instance_state(GncSxSlrTreeModelAdapter *model, GncSxInstance *instance, GncSxInstanceState new_state)
-{
-    // @fixme: pop this out a level.
-    gnc_sx_instance_model_change_instance_state(model->instances, instance, new_state);
-}
-
 /**
  * Special-case list indexing that only refers to "editable" variables. :(
  **/
@@ -709,12 +700,6 @@
     return path;
 }
 
-void
-gnc_sx_slr_model_change_variable(GncSxSlrTreeModelAdapter *model, GncSxInstance *instance, GncSxVariable *variable, gnc_numeric *new_value)
-{
-    gnc_sx_instance_model_set_variable(model->instances, instance, variable, new_value);
-}
-
 static void
 gsslrtma_added_cb(GncSxInstanceModel *instances, SchedXaction *added_sx, gpointer user_data)
 {
@@ -867,7 +852,7 @@
         return;
     }
 
-    gnc_sx_slr_model_change_instance_state(dialog->editing_model, inst, new_state);
+    gnc_sx_instance_model_change_instance_state(dialog->editing_model->instances, inst, new_state);
 }
 
 static void
@@ -903,8 +888,7 @@
         if (strlen(g_strstrip(value_copy)) == 0)
         {
             gnc_numeric invalid_num = gnc_numeric_error(GNC_ERROR_ARG);
-            // @fixme? Change to gnc_sx_slr_model_clear_variable(...)?
-            gnc_sx_slr_model_change_variable(dialog->editing_model, inst, var, &invalid_num);
+            gnc_sx_instance_model_set_variable(dialog->editing_model->instances, inst, var, &invalid_num);
         }
         else
         {
@@ -913,7 +897,7 @@
         g_free(value_copy);
         return;
     }
-    gnc_sx_slr_model_change_variable(dialog->editing_model, inst, var, &parsed_num);
+    gnc_sx_instance_model_set_variable(dialog->editing_model->instances, inst, var, &parsed_num);
 }
 
 GncSxSinceLastRunDialog*
@@ -1024,12 +1008,6 @@
     xaccFreeQuery(guid_query);
 }
 
-static GList*
-gnc_sx_slr_model_check_variables(GncSxSlrTreeModelAdapter *editing_model)
-{
-    return gnc_sx_instance_model_check_variables(editing_model->instances);
-}
-
 static void
 dialog_response_cb(GtkDialog *dialog, gint response_id, GncSxSinceLastRunDialog *app_dialog)
 {
@@ -1037,12 +1015,12 @@
     {
     case GTK_RESPONSE_OK:
         // @@fixme validate current state(GError *errs);
-        // - instance state constraints
-        // - required variable binding
-        // - ability to create transactions
+        // - [ ] instance state constraints
+        // - [x] required variable binding
+        // - [?] ability to create transactions
     {
         GList *unbound_variables;
-        unbound_variables = gnc_sx_slr_model_check_variables(app_dialog->editing_model);
+        unbound_variables = gnc_sx_instance_model_check_variables(app_dialog->editing_model->instances);
         g_message("%d variables unbound", g_list_length(unbound_variables));
         if (g_list_length(unbound_variables) > 0)
         {



More information about the gnucash-changes mailing list