]> Dogcows Code - chaz/homebank/blobdiff - src/hb-account.c
revert whitespace fixes
[chaz/homebank] / src / hb-account.c
index b6888c9144f2838ca7f9eb1886d3f6643511fa53..d0c9c782401f145d3f16b10d4830176f7bdea656 100644 (file)
@@ -20,6 +20,9 @@
 #include "homebank.h"
 #include "hb-account.h"
 
+#include "ext.h"
+#include "refcount.h"
+
 /****************************************************************************/
 /* Debug macros                                                                                 */
 /****************************************************************************/
@@ -39,7 +42,7 @@ void
 da_acc_free(Account *item)
 {
        DB( g_print("da_acc_free\n") );
-       if(item != NULL)
+       if(rc_unref(item))
        {
                DB( g_print(" => %d, %s\n", item->key, item->name) );
 
@@ -50,7 +53,7 @@ da_acc_free(Account *item)
                
                g_queue_free (item->txn_queue);
                
-               g_free(item);
+               rc_free(item);
        }
 }
 
@@ -61,7 +64,7 @@ da_acc_malloc(void)
 Account *item;
 
        DB( g_print("da_acc_malloc\n") );
-       item = g_malloc0(sizeof(Account));
+       item = rc_alloc(sizeof(Account));
        item->kcur = GLOBALS->kcur;
        item->txn_queue = g_queue_new ();
        return item;
@@ -158,6 +161,9 @@ guint32 *new_key;
        *new_key = item->key;
        g_hash_table_insert(GLOBALS->h_acc, new_key, item);
 
+       GValue item_val = G_VALUE_INIT;
+       ext_hook("account_inserted", EXT_ACCOUNT(&item_val, item), NULL);
+
        return TRUE;
 }
 
@@ -183,6 +189,10 @@ Account *existitem;
                item->key = da_acc_get_max_key() + 1;
                item->pos = da_acc_length() + 1;
                da_acc_insert(item);
+
+               GValue item_val = G_VALUE_INIT;
+               ext_hook("account_inserted", EXT_ACCOUNT(&item_val, item), NULL);
+
                return TRUE;
        }
 
This page took 0.021258 seconds and 4 git commands to generate.