Revert "Replace no-op function force_account_dirty with qof_book_mark_dirty"

This commit had some unintended changes.

This reverts commit 6b6eba2d7e56a4359ca646abb2b0c6c965712ce0.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21739 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens 2011-12-18 18:12:52 +00:00
parent 885898feda
commit ef7d41a956
2 changed files with 19 additions and 5 deletions

View File

@ -42,6 +42,7 @@
/* This static indicates the debugging module that this .o belongs to. */
static QofLogModule log_module = G_LOG_DOMAIN;
static void force_account_dirty(Account *acct);
static kvp_frame *gnc_ab_get_account_kvp(const Account *a, gboolean create);
static kvp_frame *gnc_ab_get_book_kvp(QofBook *b, gboolean create);
@ -60,7 +61,7 @@ gnc_ab_set_account_accountid(Account *a, const gchar *id)
kvp_value *value = kvp_value_new_string(id);
xaccAccountBeginEdit(a);
kvp_frame_set_slot_nc(frame, AB_ACCOUNT_ID, value);
qof_book_mark_dirty(gnc_get_current_book());
force_account_dirty(a);
xaccAccountCommitEdit(a);
}
@ -79,7 +80,7 @@ gnc_ab_set_account_bankcode(Account *a, const gchar *code)
kvp_value *value = kvp_value_new_string(code);
xaccAccountBeginEdit(a);
kvp_frame_set_slot_nc(frame, AB_BANK_CODE, value);
qof_book_mark_dirty(gnc_get_current_book());
force_account_dirty(a);
xaccAccountCommitEdit(a);
}
@ -98,7 +99,7 @@ gnc_ab_set_account_uid(Account *a, guint32 uid)
kvp_value *value = kvp_value_new_gint64(uid);
xaccAccountBeginEdit(a);
kvp_frame_set_slot_nc(frame, AB_ACCOUNT_UID, value);
qof_book_mark_dirty(gnc_get_current_book());
force_account_dirty(a);
xaccAccountCommitEdit(a);
}
@ -117,7 +118,7 @@ gnc_ab_set_account_trans_retrieval(Account *a, Timespec time)
kvp_value *value = kvp_value_new_timespec(time);
xaccAccountBeginEdit(a);
kvp_frame_set_slot_nc(frame, AB_TRANS_RETRIEVAL, value);
qof_book_mark_dirty(gnc_get_current_book());
force_account_dirty(a);
xaccAccountCommitEdit(a);
}
@ -140,6 +141,20 @@ gnc_ab_set_book_template_list(QofBook *b, GList *template_list)
qof_book_commit_edit(b);
}
static void
force_account_dirty(Account *acct)
{
gchar *name = g_strdup(xaccAccountGetName(acct));
QofBook *book = gnc_get_current_book ();
/* This is necessary because modifying the KvpFrames doesn't mark
* accounts dirty, which means the changes wont be propagated to the
* backend.
*/
qof_book_mark_dirty(book);
xaccAccountSetName(acct, name);
g_free(name);
}
static kvp_frame *
gnc_ab_get_account_kvp(const Account *a, gboolean create)
{

View File

@ -118,7 +118,6 @@
)
)
(gnc:debug "stdrpt-dir=" (gnc-path-get-stdreportsdir))
(gnc:debug "dir-files=" (directory-files (gnc-path-get-stdreportsdir)))
(gnc:debug "processed=" (process-file-list (directory-files (gnc-path-get-stdreportsdir))))
(gnc:debug "report-list=" (get-report-list))