diff --git a/ChangeLog b/ChangeLog index 37d8e3a660..27ffd2ff33 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2003-01-04 David Hampton + * src/backend/file/gnc-account-xml-v2.c: + * src/backend/file/gnc-book-xml-v2.c: + * src/backend/file/io-gncxml-v2.c: + * src/backend/file/io-utils.c: + * src/backend/file/test/test-xml-account.c: Don't export lots. + + * src/engine/gnc-session.c (gnc_session_destroy): Don't clear the + current_session global unless the actual current session is being + destroyed. 101707. + * src/backend/file/io-gncxml-v2.c: Pipe the output through zlib if the user requested compression. This request is either setting a option in the preferences (for all files), or naming the diff --git a/src/backend/file/gnc-account-xml-v2.c b/src/backend/file/gnc-account-xml-v2.c index e9d9e4fd1e..2aef5d549d 100644 --- a/src/backend/file/gnc-account-xml-v2.c +++ b/src/backend/file/gnc-account-xml-v2.c @@ -73,7 +73,7 @@ const gchar *account_version_string = "2.0.0"; #define act_security_scu_string "act:security-scu" xmlNodePtr -gnc_account_dom_tree_create(Account *act) +gnc_account_dom_tree_create(Account *act, gboolean exporting) { const char *str; kvp_frame *kf; @@ -134,7 +134,7 @@ gnc_account_dom_tree_create(Account *act) n = xaccAccountGetLotList (act); PINFO ("lot list=%p", n); - if (n) + if (n && !exporting) { xmlNodePtr toaddto = xmlNewChild(ret, NULL, act_lots_string, NULL); diff --git a/src/backend/file/gnc-book-xml-v2.c b/src/backend/file/gnc-book-xml-v2.c index e55ece7e71..1d189d66c2 100644 --- a/src/backend/file/gnc-book-xml-v2.c +++ b/src/backend/file/gnc-book-xml-v2.c @@ -75,7 +75,7 @@ append_group (xmlNodePtr parent, AccountGroup *grp) xmlNodePtr accnode; AccountGroup *newgrp; - accnode = gnc_account_dom_tree_create((Account*)(node->data)); + accnode = gnc_account_dom_tree_create((Account*)(node->data), FALSE); xmlAddChild (parent, accnode); newgrp = xaccAccountGetChildren((Account*)(node->data)); diff --git a/src/backend/file/gnc-xml.h b/src/backend/file/gnc-xml.h index 81ea942162..b3fb9702db 100644 --- a/src/backend/file/gnc-xml.h +++ b/src/backend/file/gnc-xml.h @@ -34,7 +34,7 @@ #include "gnc-xml-helper.h" #include "sixtp.h" -xmlNodePtr gnc_account_dom_tree_create(Account *act); +xmlNodePtr gnc_account_dom_tree_create(Account *act, gboolean exporting); sixtp* gnc_account_sixtp_parser_create(void); xmlNodePtr gnc_book_dom_tree_create(GNCBook *book); diff --git a/src/backend/file/io-gncxml-v2.c b/src/backend/file/io-gncxml-v2.c index 857a8e6f03..e4253a7b7d 100644 --- a/src/backend/file/io-gncxml-v2.c +++ b/src/backend/file/io-gncxml-v2.c @@ -647,6 +647,7 @@ add_parser_cb (const char *type, gpointer data_p, gpointer be_data_p) static sixtp_gdv2 * gnc_sixtp_gdv2_new ( GNCBook *book, + gboolean exporting, countCallbackFn countcallback, GNCBePercentageFunc gui_display_fn) { @@ -667,7 +668,7 @@ gnc_sixtp_gdv2_new ( gd->counter.prices_total = 0; gd->counter.schedXactions_loaded = 0; gd->counter.schedXactions_total = 0; - + gd->exporting = exporting; gd->countCallback = countcallback; gd->gui_display_fn = gui_display_fn; return gd; @@ -686,7 +687,7 @@ gnc_session_load_from_xml_file_v2(GNCSession *session) book = gnc_session_get_book (session); be = (Backend *)gnc_book_get_backend(book); - gd = gnc_sixtp_gdv2_new(book, file_rw_feedback, be->percentage); + gd = gnc_sixtp_gdv2_new(book, FALSE, file_rw_feedback, be->percentage); top_parser = sixtp_new(); main_parser = sixtp_new(); @@ -1114,7 +1115,7 @@ gnc_book_write_to_xml_filehandle_v2(GNCBook *book, FILE *out) NULL); be = (Backend *)gnc_book_get_backend(book); - gd = gnc_sixtp_gdv2_new(book, file_rw_feedback, be->percentage); + gd = gnc_sixtp_gdv2_new(book, FALSE, file_rw_feedback, be->percentage); gd->counter.commodities_total = gnc_commodity_table_get_size(gnc_book_get_commodity_table(book)); gd->counter.accounts_total = 1 + @@ -1151,7 +1152,7 @@ gnc_book_write_accounts_to_xml_filehandle_v2(Backend *be, GNCBook *book, FILE *o 1 + xaccGroupGetNumSubAccounts(gnc_book_get_group(book)), NULL); - gd = gnc_sixtp_gdv2_new(book, file_rw_feedback, be->percentage); + gd = gnc_sixtp_gdv2_new(book, TRUE, file_rw_feedback, be->percentage); gd->counter.commodities_total = gnc_commodity_table_get_size(gnc_book_get_commodity_table(book)); gd->counter.accounts_total = 1 + diff --git a/src/backend/file/io-gncxml-v2.h b/src/backend/file/io-gncxml-v2.h index 3f2c05ae2a..965cc7d7c2 100644 --- a/src/backend/file/io-gncxml-v2.h +++ b/src/backend/file/io-gncxml-v2.h @@ -73,6 +73,7 @@ struct sixtp_gdv2 load_counter counter; countCallbackFn countCallback; GNCBePercentageFunc gui_display_fn; + gboolean exporting; }; /** diff --git a/src/backend/file/io-utils.c b/src/backend/file/io-utils.c index 9ede61745c..e4cde700c4 100644 --- a/src/backend/file/io-utils.c +++ b/src/backend/file/io-utils.c @@ -31,7 +31,7 @@ #include "Group.h" #include "gnc-book.h" #include "gnc-xml.h" -#include "gnc-xml-helper.h" +#include "gnc-xml.h" #include "io-utils.h" /* @@ -65,7 +65,8 @@ write_account_group(FILE *out, AccountGroup *grp, sixtp_gdv2 *gd) xmlNodePtr accnode; AccountGroup *newgrp; - accnode = gnc_account_dom_tree_create((Account*)(node->data)); + accnode = gnc_account_dom_tree_create((Account*)(node->data), + gd && gd->exporting); xmlElemDump(out, NULL, accnode); fprintf(out, "\n"); diff --git a/src/backend/file/test/test-xml-account.c b/src/backend/file/test/test-xml-account.c index e6aed6ad3f..3655a09bd4 100644 --- a/src/backend/file/test/test-xml-account.c +++ b/src/backend/file/test/test-xml-account.c @@ -229,7 +229,7 @@ test_account(int i, Account *test_act) gchar *compare_msg; int fd; - test_node = gnc_account_dom_tree_create(test_act); + test_node = gnc_account_dom_tree_create(test_act, FALSE); if(!test_node) {