mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Prevent gnc-commodity from marking the book dirty at file-load.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23733 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
6b083f45a3
commit
8be7d15e1d
@ -1078,7 +1078,8 @@ static void
|
|||||||
xml_commit_edit (QofBackend *be, QofInstance *inst)
|
xml_commit_edit (QofBackend *be, QofInstance *inst)
|
||||||
{
|
{
|
||||||
if (qof_instance_get_dirty(inst) && qof_get_alt_dirty_mode() &&
|
if (qof_instance_get_dirty(inst) && qof_get_alt_dirty_mode() &&
|
||||||
!(qof_instance_get_infant(inst) && qof_instance_get_destroying(inst)))
|
!(qof_instance_get_infant(inst) ||
|
||||||
|
qof_instance_get_destroying(inst)))
|
||||||
{
|
{
|
||||||
qof_collection_mark_dirty(qof_instance_get_collection(inst));
|
qof_collection_mark_dirty(qof_instance_get_collection(inst));
|
||||||
qof_book_mark_session_dirty(qof_instance_get_book(inst));
|
qof_book_mark_session_dirty(qof_instance_get_book(inst));
|
||||||
|
@ -273,6 +273,8 @@ gnc_commodity_end_handler(gpointer data_for_children,
|
|||||||
g_return_val_if_fail(tree, FALSE);
|
g_return_val_if_fail(tree, FALSE);
|
||||||
|
|
||||||
com = gnc_commodity_new(book, NULL, NULL, NULL, NULL, 0);
|
com = gnc_commodity_new(book, NULL, NULL, NULL, NULL, 0);
|
||||||
|
gnc_commodity_begin_edit (com);
|
||||||
|
|
||||||
old_com = gnc_commodity_find_currency(book, tree);
|
old_com = gnc_commodity_find_currency(book, tree);
|
||||||
if (old_com)
|
if (old_com)
|
||||||
gnc_commodity_copy(com, old_com);
|
gnc_commodity_copy(com, old_com);
|
||||||
@ -281,6 +283,11 @@ gnc_commodity_end_handler(gpointer data_for_children,
|
|||||||
{
|
{
|
||||||
set_commodity_value(achild, com);
|
set_commodity_value(achild, com);
|
||||||
}
|
}
|
||||||
|
/* We're loading from the file. It can't be dirty, even though the
|
||||||
|
* commodity set functions have marked it so.
|
||||||
|
*/
|
||||||
|
qof_instance_mark_clean (QOF_INSTANCE (com));
|
||||||
|
gnc_commodity_commit_edit (com);
|
||||||
|
|
||||||
if (!valid_commodity(com))
|
if (!valid_commodity(com))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user