From 59056ce619e723b5d92853b7346021c745cfc149 Mon Sep 17 00:00:00 2001 From: David Hampton Date: Thu, 9 Mar 2006 06:08:02 +0000 Subject: [PATCH] Remove more functions to be deprecated in libqof2. (Pass Three - more trivial substitutions and simple translations.) git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13550 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 7 +++++++ lib/libqof/qof/qofquery.c | 2 +- lib/libqof/qof/qofsession.c | 16 ++++++++-------- src/engine/Group.c | 2 +- src/engine/gw-engine-spec.scm | 14 +++++++------- 5 files changed, 24 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 198e81f5af..d5f93a59a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2006-03-09 David Hampton + * src/engine/gw-engine-spec.scm: + * src/engine/Group.c: + * lib/libqof/qof/qofquery.c: + * lib/libqof/qof/qofsession.c: Remove more functions to be + deprecated in libqof2. (Pass Three - more trivial substitutions + and simple translations.) + * numerous: Never include "config.h" from a header file. Doing so makes it nigh impossible to override configuration settings. diff --git a/lib/libqof/qof/qofquery.c b/lib/libqof/qof/qofquery.c index 0e1260abb8..66af0419cb 100644 --- a/lib/libqof/qof/qofquery.c +++ b/lib/libqof/qof/qofquery.c @@ -703,7 +703,7 @@ GList * qof_query_run (QofQuery *q) } /* Maybe log this sucker */ - if (gnc_should_log (log_module, GNC_LOG_DETAIL)) qof_query_print (q); + if (qof_log_check (log_module, QOF_LOG_DETAIL)) qof_query_print (q); /* Now run the query over all the objects and save the results */ { diff --git a/lib/libqof/qof/qofsession.c b/lib/libqof/qof/qofsession.c index cf407ecf2d..16a4ac254f 100644 --- a/lib/libqof/qof/qofsession.c +++ b/lib/libqof/qof/qofsession.c @@ -214,9 +214,9 @@ qof_session_get_current_session (void) { if (!current_session) { - gnc_engine_suspend_events (); + qof_event_suspend (); current_session = qof_session_new (); - gnc_engine_resume_events (); + qof_event_resume (); } return current_session; @@ -634,7 +634,7 @@ qof_entity_copy_to_session(QofSession* new_session, QofEntity* original) if(!new_session || !original) { return FALSE; } if(qof_entity_guid_match(new_session, original)) { return FALSE; } if(!qof_object_compliance(original->e_type, TRUE)) { return FALSE; } - gnc_engine_suspend_events(); + qof_event_suspend(); qecd.param_list = NULL; book = qof_session_get_book(new_session); qecd.new_session = new_session; @@ -649,7 +649,7 @@ qof_entity_copy_to_session(QofSession* new_session, QofEntity* original) if(g_slist_length(qecd.param_list) == 0) { return FALSE; } g_slist_foreach(qecd.param_list, qof_entity_foreach_copy, &qecd); g_slist_free(qecd.param_list); - gnc_engine_resume_events(); + qof_event_resume(); return TRUE; } @@ -660,12 +660,12 @@ gboolean qof_entity_copy_list(QofSession *new_session, GList *entity_list) if(!new_session || !entity_list) { return FALSE; } ENTER (" list=%d", g_list_length(entity_list)); qecd = g_new0(QofEntityCopyData, 1); - gnc_engine_suspend_events(); + qof_event_suspend(); qecd->param_list = NULL; qecd->new_session = new_session; qof_book_set_partial(qof_session_get_book(new_session)); g_list_foreach(entity_list, qof_entity_list_foreach, qecd); - gnc_engine_resume_events(); + qof_event_resume(); if(qecd->error) { PWARN (" some/all entities in the list could not be copied."); @@ -682,7 +682,7 @@ qof_entity_copy_coll(QofSession *new_session, QofCollection *entity_coll) g_return_val_if_fail(new_session, FALSE); if(!entity_coll) { return FALSE; } - gnc_engine_suspend_events(); + qof_event_suspend(); qecd.param_list = NULL; qecd.new_session = new_session; qof_book_set_partial(qof_session_get_book(qecd.new_session)); @@ -691,7 +691,7 @@ qof_entity_copy_coll(QofSession *new_session, QofCollection *entity_coll) qof_entity_param_cb, &qecd); qof_collection_foreach(entity_coll, qof_entity_coll_copy, &qecd); if(qecd.param_list != NULL) { g_slist_free(qecd.param_list); } - gnc_engine_resume_events(); + qof_event_resume(); return TRUE; } diff --git a/src/engine/Group.c b/src/engine/Group.c index 5a9d355056..406ab2c266 100644 --- a/src/engine/Group.c +++ b/src/engine/Group.c @@ -756,7 +756,7 @@ xaccGroupInsertAccount (AccountGroup *grp, Account *acc) group_sort_helper); /* Gather event data */ - gnc_engine_gen_event (&acc->inst.entity, GNC_EVENT_ADD); + qof_event_gen (&acc->inst.entity, QOF_EVENT_ADD, NULL); acc->inst.dirty = TRUE; xaccAccountCommitEdit (acc); diff --git a/src/engine/gw-engine-spec.scm b/src/engine/gw-engine-spec.scm index 41bfef5755..b2e8442d72 100644 --- a/src/engine/gw-engine-spec.scm +++ b/src/engine/gw-engine-spec.scm @@ -111,11 +111,11 @@ (let ((wt (gw:wrap-enumeration ws ' "QofEventId"))) - (gw:enum-add-value! wt "QOF_EVENT_NONE" 'gnc-event-none) - (gw:enum-add-value! wt "QOF_EVENT_CREATE" 'gnc-event-create) - (gw:enum-add-value! wt "QOF_EVENT_MODIFY" 'gnc-event-modify) - (gw:enum-add-value! wt "QOF_EVENT_DESTROY" 'gnc-event-destroy) - (gw:enum-add-value! wt "QOF_EVENT_ALL" 'gnc-event-all)) + (gw:enum-add-value! wt "QOF_EVENT_NONE" 'qof-event-none) + (gw:enum-add-value! wt "QOF_EVENT_CREATE" 'qof-event-create) + (gw:enum-add-value! wt "QOF_EVENT_MODIFY" 'qof-event-modify) + (gw:enum-add-value! wt "QOF_EVENT_DESTROY" 'qof-event-destroy) + (gw:enum-add-value! wt "QOF_EVENT_ALL" 'qof-event-all)) (let ((wt (gw:wrap-enumeration ws ' "QofQueryOp"))) @@ -2463,7 +2463,7 @@ the timepair representing midday on that day") (gw:wrap-function ws - 'gnc:engine-suspend-events + 'qof:event-suspend ' "qof_event_suspend" '() @@ -2471,7 +2471,7 @@ the timepair representing midday on that day") (gw:wrap-function ws - 'gnc:engine-resume-events + 'qof:event-resume ' "qof_event_resume" '()