From 4a77848ad7183e7f20dcc12ecd88d4bbd21ec5df Mon Sep 17 00:00:00 2001 From: David Hampton Date: Wed, 26 Apr 2006 04:14:04 +0000 Subject: [PATCH] Mark the collections as clean after the default items have been created. Fixes #337185. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13859 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 4 ++++ src/engine/gnc-commodity.c | 10 ++++++++++ src/engine/gnc-pricedb.c | 1 + 3 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index a54bf5b579..66bb1aa5bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-04-25 David Hampton + * src/engine/gnc-pricedb.c: + * src/engine/gnc-commodity.c: Mark the collections as clean after + the default items have been created. Fixes #337185. + * src/scm/price-quotes.scm: Fix the crash in #339764. 2006-04-25 Joshua Sled diff --git a/src/engine/gnc-commodity.c b/src/engine/gnc-commodity.c index c4ea633bfa..244f673426 100644 --- a/src/engine/gnc-commodity.c +++ b/src/engine/gnc-commodity.c @@ -1712,6 +1712,8 @@ gnc_commodity_table_copy(gnc_commodity_table *dest, gboolean gnc_commodity_table_add_default_data(gnc_commodity_table *table, QofBook *book) { + QofCollection *col; + ENTER ("table=%p", table); gnc_commodity_table_add_namespace(table, GNC_COMMODITY_NS_AMEX, book); gnc_commodity_table_add_namespace(table, GNC_COMMODITY_NS_NYSE, book); @@ -1721,6 +1723,14 @@ gnc_commodity_table_add_default_data(gnc_commodity_table *table, QofBook *book) #include "iso-4217-currencies.c" + /* We've just created the default namespaces and currencies. Mark + * these collections as clean because there is no USER entered data + * in these collections as of yet. */ + col = qof_book_get_collection(book, GNC_ID_COMMODITY); + qof_collection_mark_clean(col); + col = qof_book_get_collection(book, GNC_ID_COMMODITY_NAMESPACE); + qof_collection_mark_clean(col); + LEAVE ("table=%p", table); return TRUE; } diff --git a/src/engine/gnc-pricedb.c b/src/engine/gnc-pricedb.c index c7e64184c0..107e2fd4af 100644 --- a/src/engine/gnc-pricedb.c +++ b/src/engine/gnc-pricedb.c @@ -584,6 +584,7 @@ gnc_pricedb_create(QofBook * book) result = g_new0(GNCPriceDB, 1); qof_instance_init (&result->inst, GNC_ID_PRICEDB, book); + qof_collection_mark_clean(col); /** \todo This leaks result when the collection is destroyed. When qofcollection is fixed to allow a destroy notifier, we'll need to