[Gnucash-changes] Force account dirty after modifying its kvp_frame.
Christian Stimming
cstim at cvs.gnucash.org
Sat Feb 26 06:01:13 EST 2005
Log Message:
-----------
Force account dirty after modifying its kvp_frame.
2005-02-26 Christian Stimming <stimming at tuhh.de>
* src/import-export/hbci/gnc-hbci-kvp.c (force_account_dirty):
Force account 'dirty' after modifying the kvp_frame. Hopefully
fixes #165096.
Tags:
----
gnucash-1-8-branch
Modified Files:
--------------
gnucash:
ChangeLog
gnucash/src/import-export/hbci:
gnc-hbci-kvp.c
Revision Data
-------------
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1461.2.401
retrieving revision 1.1461.2.402
diff -LChangeLog -LChangeLog -u -r1.1461.2.401 -r1.1461.2.402
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,9 @@
+2005-02-26 Christian Stimming <stimming at tuhh.de>
+
+ * src/import-export/hbci/gnc-hbci-kvp.c (force_account_dirty):
+ Force account 'dirty' after modifying the kvp_frame. Hopefully
+ fixes #165096.
+
2005-02-21 Christian Stimming <stimming at tuhh.de>
* src/import-export/import-backend.c, import-backend.h,
Index: gnc-hbci-kvp.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/gnc-hbci-kvp.c,v
retrieving revision 1.4.2.2
retrieving revision 1.4.2.3
diff -Lsrc/import-export/hbci/gnc-hbci-kvp.c -Lsrc/import-export/hbci/gnc-hbci-kvp.c -u -r1.4.2.2 -r1.4.2.3
--- src/import-export/hbci/gnc-hbci-kvp.c
+++ src/import-export/hbci/gnc-hbci-kvp.c
@@ -31,6 +31,14 @@
#define HBCI_TRANS_RETRIEVAL "trans-retrieval"
#define HBCI_ACCOUNTS "hbci-accounts"
+static void force_account_dirty(Account *acct)
+{
+ /* This is necessary because modifying the KvpFrames doesn't mark
+ accounts dirty, which means the changes wont be propagated to the
+ backend. */
+ xaccAccountSetSlots_nc(acct, xaccAccountGetSlots(acct));
+}
+
/* Account */
char *gnc_hbci_get_account_accountid (Account *a)
{
@@ -56,6 +64,7 @@
kvp_value *value = kvp_value_new_string (id);
xaccAccountBeginEdit(a);
kvp_frame_set_slot_nc (frame, HBCI_ACCOUNT_ID, value);
+ force_account_dirty (a);
xaccAccountCommitEdit (a);
}
void gnc_hbci_set_account_bankcode (Account *a, const char *code)
@@ -64,6 +73,7 @@
kvp_value *value = kvp_value_new_string (code);
xaccAccountBeginEdit (a);
kvp_frame_set_slot_nc (frame, HBCI_BANK_CODE, value);
+ force_account_dirty (a);
xaccAccountCommitEdit (a);
}
void gnc_hbci_set_account_countrycode (Account *a, gint code)
@@ -72,6 +82,7 @@
kvp_value *value = kvp_value_new_gint64 (code);
xaccAccountBeginEdit (a);
kvp_frame_set_slot_nc (frame, HBCI_COUNTRY_CODE, value);
+ force_account_dirty (a);
xaccAccountCommitEdit (a);
}
gint gnc_hbci_get_account_uid (Account *a)
@@ -86,6 +97,7 @@
kvp_value *value = kvp_value_new_gint64 (uid);
xaccAccountBeginEdit (a);
kvp_frame_set_slot_nc (frame, HBCI_ACCOUNT_UID, value);
+ force_account_dirty (a);
xaccAccountCommitEdit (a);
}
Timespec gnc_hbci_get_account_trans_retrieval (Account *a)
@@ -100,6 +112,7 @@
kvp_value *value = kvp_value_new_timespec (time);
xaccAccountBeginEdit (a);
kvp_frame_set_slot_nc (frame, HBCI_TRANS_RETRIEVAL, value);
+ force_account_dirty (a);
xaccAccountCommitEdit (a);
}
More information about the gnucash-changes
mailing list