]> Dogcows Code - chaz/homebank/blobdiff - src/ext-perl.xs
convert some spaces to tabs
[chaz/homebank] / src / ext-perl.xs
index 80020473e87e9c00516c8fbc0131e29a4097f02d..4890db85a56e2c7cd4b91548dc5009f6fa083ada 100644 (file)
@@ -172,10 +172,10 @@ static inline GObject* SvGobject(const SV* sv)
 
 static inline SV* newSVgobject(const GObject* o)
 {
-    SV* (*func)(const GObject*, gboolean) = ext_symbol_lookup("gperl_new_object");
-    if (func) {
-        return func(o, FALSE);
-    }
+       SV* (*func)(const GObject*, gboolean) = ext_symbol_lookup("gperl_new_object");
+       if (func) {
+               return func(o, FALSE);
+       }
        return &PL_sv_undef;
 }
 
@@ -665,13 +665,24 @@ void
 transactions(const gchar* CLASS)
        PPCODE:
                PERL_UNUSED_ARG(CLASS);
-               GList* list = g_list_first(GLOBALS->ope_list);
-               for (; list; list = g_list_next(list)) {
-                       GValue val = G_VALUE_INIT;
-                       SV* sv = val_to_sv(EXT_TRANSACTION(&val, list->data));
-                       mXPUSHs(sv);
+
+               GList* acc_list = g_hash_table_get_values(GLOBALS->h_acc);
+               GList* acc_link = g_list_first(acc_list);
+               for (; acc_link; acc_link = g_list_next(acc_link)) {
+                       Account *acc = acc_link->data;
+
+                       GList* txn_link = g_queue_peek_head_link(acc->txn_queue);
+                       for (; txn_link; txn_link = g_list_next(txn_link)) {
+                               Transaction* txn = txn_link->data;
+
+                               GValue val = G_VALUE_INIT;
+                               SV* sv = val_to_sv(EXT_TRANSACTION(&val, txn));
+                               mXPUSHs(sv);
+                       }
                }
 
+               g_list_free(acc_list);
+
 void
 anonymize(void)
        CODE:
@@ -737,14 +748,6 @@ new(void)
        OUTPUT:
                RETVAL
 
-Account*
-clone(Account* SELF)
-       CODE:
-               RETVAL = da_acc_clone(SELF);
-               RETVAL->key = 0;
-       OUTPUT:
-               RETVAL
-
 void
 DESTROY(Account* SELF)
        CODE:
@@ -896,14 +899,12 @@ remove(Account* SELF)
 void
 transactions(Account* SELF)
        PPCODE:
-               GList* list = g_list_first(GLOBALS->ope_list);
+               GList* list = g_queue_peek_head_link(SELF->txn_queue);
                for (; list; list = g_list_next(list)) {
                        Transaction* txn = list->data;
-                       if (txn->kacc == SELF->key) {
-                               GValue val = G_VALUE_INIT;
-                               SV* sv = val_to_sv(EXT_TRANSACTION(&val, txn));
-                               mXPUSHs(sv);
-                       }
+                       GValue val = G_VALUE_INIT;
+                       SV* sv = val_to_sv(EXT_TRANSACTION(&val, txn));
+                       mXPUSHs(sv);
                }
 
 GObject*
@@ -979,13 +980,13 @@ date(Transaction* SELF, ...)
                }
 
 const gchar*
-wording(Transaction* SELF, ...)
+memo(Transaction* SELF, ...)
        CODE:
                if (1 < items) {
-                       if (SELF->wording) g_free(SELF->wording);
-                       SELF->wording = g_strdup(SvGchar_ptr(ST(1)));
+                       if (SELF->memo) g_free(SELF->memo);
+                       SELF->memo = g_strdup(SvGchar_ptr(ST(1)));
                }
-               RETVAL = SELF->wording ? SELF->wording : "";
+               RETVAL = SELF->memo ? SELF->memo : "";
        OUTPUT:
                RETVAL
 
@@ -1003,7 +1004,7 @@ info(Transaction* SELF, ...)
 GObject*
 open(Transaction* SELF)
        CODE:
-               RETVAL = G_OBJECT(create_deftransaction_window(NULL, TRANSACTION_EDIT_MODIFY));
+               RETVAL = G_OBJECT(create_deftransaction_window(NULL, TRANSACTION_EDIT_MODIFY, FALSE));
                deftransaction_set_transaction(GTK_WIDGET(RETVAL), SELF);
        OUTPUT:
                RETVAL
@@ -1022,7 +1023,7 @@ pair_with(Transaction* SELF, Transaction* other, ...)
                                EXT_P2C_OBJECT("HomeBank::Transaction", sv, ptr, Transaction*);
                                list = g_list_append(list, ptr);
                        }
-                       other = ui_dialog_transaction_xfer_select_child(list);
+                       other = ui_dialog_transaction_xfer_select_child(SELF, list);
                }
                if (other) {
                        transaction_xfer_change_to_child(SELF, other);
@@ -1038,5 +1039,5 @@ void
 dump(Transaction* SELF)
        CODE:
                g_print("txn: %p (%s) at %u (%d/%d) flags:%d, paymode:%d, kpay:%d, kcat:%d", SELF,
-                       SELF->wording, SELF->date, SELF->kacc, SELF->kxferacc, SELF->flags, SELF->paymode, SELF->kpay, SELF->kcat);
+                       SELF->memo, SELF->date, SELF->kacc, SELF->kxferacc, SELF->flags, SELF->paymode, SELF->kpay, SELF->kcat);
 
This page took 0.024962 seconds and 4 git commands to generate.