]> Dogcows Code - chaz/homebank/blobdiff - src/hb-transaction.c
Merge branch 'master' into ext-perl
[chaz/homebank] / src / hb-transaction.c
index 29812d9ce5e1050640b55f05998c512d66a95c0a..eb825093e8b674239d7c4a3c4a326cde61e1d7bd 100644 (file)
@@ -23,6 +23,9 @@
 #include "hb-tag.h"
 #include "hb-split.h"
 
+#include "ext.h"
+#include "refcount.h"
+
 /****************************************************************************/
 /* Debug macros                                                                                                        */
 /****************************************************************************/
@@ -78,10 +81,10 @@ da_transaction_clean(Transaction *item)
 void
 da_transaction_free(Transaction *item)
 {
-       if(item != NULL)
+       if(rc_unref(item))
        {
                da_transaction_clean(item);
-               g_free(item);
+               rc_free(item);
        }
 }
 
@@ -89,7 +92,7 @@ da_transaction_free(Transaction *item)
 Transaction *
 da_transaction_malloc(void)
 {
-       return g_malloc0(sizeof(Transaction));
+       return rc_alloc(sizeof(Transaction));
 }
 
 
@@ -139,7 +142,7 @@ Transaction *da_transaction_init_from_template(Transaction *txn, Archive *arc)
 
 Transaction *da_transaction_clone(Transaction *src_item)
 {
-Transaction *new_item = g_memdup(src_item, sizeof(Transaction));
+Transaction *new_item = rc_dup(src_item, sizeof(Transaction));
 
        DB( g_print("da_transaction_clone\n") );
 
@@ -512,6 +515,9 @@ gchar swap;
 
                        account_balances_add (child);
 
+                       GValue txn_value = G_VALUE_INIT;
+                       ext_hook("transaction_inserted", EXT_TRANSACTION(&txn_value, child), NULL);
+
                }
        }
 
@@ -946,6 +952,9 @@ Account *acc;
                {
                        transaction_xfer_search_or_add_child(NULL, newope, FALSE);
                }
+
+               GValue txn_value = G_VALUE_INIT;
+               ext_hook("transaction_inserted", EXT_TRANSACTION(&txn_value, newope), NULL);
        }
        
        return newope;
This page took 0.021175 seconds and 4 git commands to generate.