/* HomeBank -- Free, easy, personal accounting for everyone.
- * Copyright (C) 1995-2017 Maxime DOYEN
+ * Copyright (C) 1995-2018 Maxime DOYEN
*
* This file is part of HomeBank.
*
#include "homebank.h"
#include "hb-account.h"
+#include "ext.h"
+#include "refcount.h"
+
/****************************************************************************/
/* Debug macros */
/****************************************************************************/
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) );
g_queue_free (item->txn_queue);
- g_free(item);
+ rc_free(item);
}
}
Account *item;
DB( g_print("da_acc_malloc\n") );
- item = g_malloc0(sizeof(Account));
+ item = rc_alloc(sizeof(Account));
item->txn_queue = g_queue_new ();
return item;
}
*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;
}
DB( g_print(" -> insert id: %d\n", *new_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;
}
}
gdouble oldamount = txn->amount;
txn->amount = hb_amount_to_euro(oldamount);
- DB( g_print("%10.6f => %10.6f, %s\n", oldamount, txn->amount, txn->wording) );
+ DB( g_print("%10.6f => %10.6f, %s\n", oldamount, txn->amount, txn->memo) );
//todo: sync child xfer
lnk_txn = g_list_next(lnk_txn);
}