r16431 - gnucash/branches/register-rewrite/src - Update the new code for API changes that were merges from trunk.

Chris Shoemaker chris at cvs.gnucash.org
Mon Aug 13 23:10:57 EDT 2007


Author: chris
Date: 2007-08-13 23:10:54 -0400 (Mon, 13 Aug 2007)
New Revision: 16431
Trac: http://svn.gnucash.org/trac/changeset/16431

Modified:
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-transaction.c
   gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-transactions.c
Log:
Update the new code for API changes that were merges from trunk.

Modified: gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-transactions.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-transactions.c	2007-08-14 03:10:51 UTC (rev 16430)
+++ gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-transactions.c	2007-08-14 03:10:54 UTC (rev 16431)
@@ -100,23 +100,12 @@
 {
     Split *split;
     Transaction *trans;
-    const char *payee;
-    const char *memo;
-    gnc_numeric amount;
     
     g_return_if_fail(GNC_IS_PLUGIN_PAGE_TRANSACTIONS(pp));
     split = gnc_tree_view_transaction_get_selected_split(GET_PRIVATE(pp)->tv);
-    trans = xaccSplitGetParent(split);
-    
-    if (split && trans) {
-        payee  = xaccTransGetDescription(trans);
-        memo   = xaccTransGetNotes(trans);
-        if (!memo)
-            memo = "";
-        amount = gnc_numeric_abs(xaccSplitGetAmount(split));
-        
-        gnc_ui_print_check_dialog_create(GNC_PLUGIN_PAGE(pp), payee, amount, 
-                                         xaccTransGetDate(trans), memo);
+
+    if (split) {
+        gnc_ui_print_check_dialog_create(GNC_PLUGIN_PAGE(pp), split);
     }
 }
 

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-transaction.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-transaction.c	2007-08-14 03:10:51 UTC (rev 16430)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-transaction.c	2007-08-14 03:10:54 UTC (rev 16431)
@@ -137,7 +137,7 @@
 /** Helper Functions ****************************************************/
 
 static void gnc_tree_model_transaction_event_handler(
-    QofEntity *entity, QofEventId event_type, gpointer tm, gpointer event_data);
+    QofInstance *entity, QofEventId event_type, gpointer tm, gpointer event_data);
 
 /************************************************************/
 /*               g_object required functions                */
@@ -327,7 +327,7 @@
             iter->user_data2,
             iter->user_data2 ? ((GList *) iter->user_data2)->data : 0,
             iter->user_data2 ?
-            ((QofEntity *)((GList *) iter->user_data2)->data)->e_type : "",
+            (QOF_INSTANCE(((GList *) iter->user_data2)->data))->e_type : "",
             iter->user_data3);
     else
         strcpy(string, "(null)");
@@ -422,9 +422,9 @@
     switch (column) {
     case GNC_TREE_MODEL_TRANSACTION_COL_GUID:
         if (is_split)
-            guid = qof_entity_get_guid((QofEntity *)split);
+            guid = qof_entity_get_guid(QOF_INSTANCE(split));
         else
-            guid = qof_entity_get_guid((QofEntity *)trans);
+            guid = qof_entity_get_guid(QOF_INSTANCE(trans));
         g_value_set_pointer(value, (gpointer) guid);
         break;
     case GNC_TREE_MODEL_TRANSACTION_COL_DATE:
@@ -1187,7 +1187,7 @@
  */
 static void
 gnc_tree_model_transaction_event_handler(
-    QofEntity *entity, QofEventId event_type, gpointer tm, gpointer event_data)
+    QofInstance *entity, QofEventId event_type, gpointer tm, gpointer event_data)
 {
     GncTreeModelTransaction *model = (GncTreeModelTransaction *) tm;
     GncTreeModelTransactionPrivate *priv = model->priv;
@@ -1201,7 +1201,7 @@
     GList *tnode;
 
     g_return_if_fail(GNC_IS_TREE_MODEL_TRANSACTION(model));
-    if (QOF_INSTANCE(entity)->book != priv->book)
+    if (qof_instance_get_book(entity) != priv->book)
         return;
     type = entity->e_type;
 



More information about the gnucash-changes mailing list