Remove more functions to be deprecated in libqof2. (Pass Two - more

trivial substitutions, some simple translations.)


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13547 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton 2006-03-09 03:48:49 +00:00
parent db890792bb
commit 61a12b2715
59 changed files with 244 additions and 241 deletions

View File

@ -1,7 +1,11 @@
2006-03-08 David Hampton <hampton@employees.org>
* numerous: Remove more functions to be deprecated in
libqof2. (Pass Two - more trivial substitutions, some simple
translations.)
* numerous: Remove functions to be deprecated in libqof2. (Pass
One - trivial substitutions)
One - trivial substitutions.)
* src/gnome-utils/gnc-tree-model-account.c:
* src/engine/Account.c:

View File

@ -179,7 +179,7 @@ gint qof_log_module_count(void);
/** Log a serious error */
#define PERR(format, args...) do { \
if (qof_log_check (log_module, GNC_LOG_ERROR)) { \
if (qof_log_check (log_module, QOF_LOG_ERROR)) { \
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, \
"Error: %s(): " format, FUNK , ## args); \
} \
@ -187,7 +187,7 @@ gint qof_log_module_count(void);
/** Log a warning */
#define PWARN(format, args...) do { \
if (qof_log_check (log_module, GNC_LOG_WARNING)) { \
if (qof_log_check (log_module, QOF_LOG_WARNING)) { \
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, \
"Warning: %s(): " format, FUNK , ## args); \
} \
@ -195,7 +195,7 @@ gint qof_log_module_count(void);
/** Print an informational note */
#define PINFO(format, args...) do { \
if (qof_log_check (log_module, GNC_LOG_INFO)) { \
if (qof_log_check (log_module, QOF_LOG_INFO)) { \
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, \
"Info: %s(): " format, \
FUNK , ## args); \
@ -204,7 +204,7 @@ gint qof_log_module_count(void);
/** Print a debugging message */
#define DEBUG(format, args...) do { \
if (qof_log_check (log_module, GNC_LOG_DEBUG)) { \
if (qof_log_check (log_module, QOF_LOG_DEBUG)) { \
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
"Debug: %s(): " format, \
FUNK , ## args); \
@ -213,7 +213,7 @@ gint qof_log_module_count(void);
/** Print a function entry debugging message */
#define ENTER(format, args...) do { \
if (qof_log_check (log_module, GNC_LOG_DEBUG)) { \
if (qof_log_check (log_module, QOF_LOG_DEBUG)) { \
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
"Enter in %s: %s()" format, __FILE__, \
FUNK , ## args); \
@ -223,7 +223,7 @@ gint qof_log_module_count(void);
/** Print a function exit debugging message */
#define LEAVE(format, args...) do { \
if (qof_log_check (log_module, GNC_LOG_DEBUG)) { \
if (qof_log_check (log_module, QOF_LOG_DEBUG)) { \
qof_log_drop_indent(); \
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
"Leave: %s()" format, \
@ -233,14 +233,14 @@ gint qof_log_module_count(void);
/** Print a function trace debugging message */
#define TRACE(format, args...) do { \
if (qof_log_check (log_module, GNC_LOG_TRACE)) { \
if (qof_log_check (log_module, QOF_LOG_TRACE)) { \
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
"Trace: %s(): " format, FUNK , ## args); \
} \
} while (0)
#define DEBUGCMD(x) do { \
if (qof_log_check (log_module, GNC_LOG_DEBUG)) { \
if (qof_log_check (log_module, QOF_LOG_DEBUG)) { \
(x); \
} \
} while (0)
@ -267,22 +267,22 @@ void qof_report_clock_total (int clockno,
/** start a particular timer */
#define START_CLOCK(clockno,format, args...) do { \
if (qof_log_check (log_module, GNC_LOG_INFO)) \
qof_start_clock (clockno, log_module, GNC_LOG_INFO, \
if (qof_log_check (log_module, QOF_LOG_INFO)) \
qof_start_clock (clockno, log_module, QOF_LOG_INFO, \
__FUNCTION__, format , ## args); \
} while (0)
/** report elapsed time since last report on a particular timer */
#define REPORT_CLOCK(clockno,format, args...) do { \
if (qof_log_check (log_module, GNC_LOG_INFO)) \
qof_report_clock (clockno, log_module, GNC_LOG_INFO, \
if (qof_log_check (log_module, QOF_LOG_INFO)) \
qof_report_clock (clockno, log_module, QOF_LOG_INFO, \
__FUNCTION__, format , ## args); \
} while (0)
/** report total elapsed time since timer started */
#define REPORT_CLOCK_TOTAL(clockno,format, args...) do { \
if (qof_log_check (log_module, GNC_LOG_INFO)) \
qof_report_clock_total (clockno, log_module, GNC_LOG_INFO, \
if (qof_log_check (log_module, QOF_LOG_INFO)) \
qof_report_clock_total (clockno, log_module, QOF_LOG_INFO, \
__FUNCTION__, format , ## args); \
} while (0)

View File

@ -34,7 +34,7 @@
typedef struct
{
GNCIdType entity_type;
GNCEngineEventType event_mask;
QofEventId event_mask;
} EntityTypeEventInfo;
typedef struct
@ -108,12 +108,12 @@ dump_components (void)
static void
clear_mask_hash_helper (gpointer key, gpointer value, gpointer user_data)
{
GNCEngineEventType * et = value;
QofEventId * et = value;
*et = 0;
}
/* clear a hash table of the form string --> GNCEngineEventType,
/* clear a hash table of the form string --> QofEventId,
* where the values are g_malloced and the keys are in the engine
* string cache. */
static void
@ -183,7 +183,7 @@ clear_event_info (ComponentEventInfo *cei)
static void
add_event (ComponentEventInfo *cei, const GUID *entity,
GNCEngineEventType event_mask, gboolean or_in)
QofEventId event_mask, gboolean or_in)
{
GHashTable *hash;
@ -234,9 +234,9 @@ add_event (ComponentEventInfo *cei, const GUID *entity,
static void
add_event_type (ComponentEventInfo *cei, GNCIdTypeConst entity_type,
GNCEngineEventType event_mask, gboolean or_in)
QofEventId event_mask, gboolean or_in)
{
GNCEngineEventType *mask;
QofEventId *mask;
g_return_if_fail (cei);
g_return_if_fail (cei->event_masks);
@ -246,7 +246,7 @@ add_event_type (ComponentEventInfo *cei, GNCIdTypeConst entity_type,
if (!mask)
{
char * key = gnc_string_cache_insert ((gpointer) entity_type);
mask = g_new0 (GNCEngineEventType, 1);
mask = g_new0 (QofEventId, 1);
g_hash_table_insert (cei->event_masks, key, mask);
}
@ -258,7 +258,7 @@ add_event_type (ComponentEventInfo *cei, GNCIdTypeConst entity_type,
static void
gnc_cm_event_handler (GUID *entity, QofIdType type,
GNCEngineEventType event_type,
QofEventId event_type,
gpointer user_data)
{
#if CM_DEBUG
@ -274,7 +274,7 @@ gnc_cm_event_handler (GUID *entity, QofIdType type,
/* split events are never generated by the engine, but might
* be generated by a backend (viz. the postgres backend.)
* Handle them like a transaction modify event. */
add_event_type (&changes, GNC_ID_TRANS, GNC_EVENT_MODIFY, TRUE);
add_event_type (&changes, GNC_ID_TRANS, QOF_EVENT_MODIFY, TRUE);
}
else
add_event_type (&changes, type, event_type, TRUE);
@ -482,7 +482,7 @@ gnc_register_gui_component_scm (const char * component_class,
void
gnc_gui_component_watch_entity (gint component_id,
const GUID *entity,
GNCEngineEventType event_mask)
QofEventId event_mask)
{
ComponentInfo *ci;
@ -502,7 +502,7 @@ gnc_gui_component_watch_entity (gint component_id,
void
gnc_gui_component_watch_entity_direct (gint component_id,
GUID entity,
GNCEngineEventType event_mask)
QofEventId event_mask)
{
gnc_gui_component_watch_entity (component_id, &entity, event_mask);
}
@ -510,7 +510,7 @@ gnc_gui_component_watch_entity_direct (gint component_id,
void
gnc_gui_component_watch_entity_type (gint component_id,
GNCIdTypeConst entity_type,
GNCEngineEventType event_mask)
QofEventId event_mask)
{
ComponentInfo *ci;
@ -528,7 +528,7 @@ const EventInfo *
gnc_gui_get_entity_events (GHashTable *changes, const GUID *entity)
{
if (!changes || !entity)
return GNC_EVENT_NONE;
return QOF_EVENT_NONE;
return g_hash_table_lookup (changes, entity);
}
@ -648,8 +648,8 @@ match_type_helper (gpointer key, gpointer value, gpointer user_data)
{
ComponentEventInfo *cei = user_data;
GNCIdType id_type = key;
GNCEngineEventType * et = value;
GNCEngineEventType * et_2;
QofEventId * et = value;
QofEventId * et_2;
et_2 = g_hash_table_lookup (cei->event_masks, id_type);
if (!et_2)

View File

@ -32,7 +32,7 @@
typedef struct
{
GNCEngineEventType event_mask;
QofEventId event_mask;
} EventInfo;
@ -64,7 +64,7 @@ typedef struct
* Notes on dealing with destroyed entities: As stated above, entities
* in the changes GHashTable may no longer exist. So how can you
* determine if this has happened? Well, it's a good idea to check
* for the GNC_EVENT_DESTROY bit in the EventInfo structure. Of
* for the QOF_EVENT_DESTROY bit in the EventInfo structure. Of
* course, that means you need the hash key (GUID) for the destroyed
* entity. How are you going to get the GUID from the entity if the
* entity has already been destroyed? You're not. So, you have to
@ -191,7 +191,7 @@ void gnc_gui_component_set_session (gint component_id, gpointer session);
*/
void gnc_gui_component_watch_entity (gint component_id,
const GUID *entity,
GNCEngineEventType event_mask);
QofEventId event_mask);
/* gnc_gui_component_watch_entity_direct
* Add an entity to the list of those being watched by the component.
@ -204,7 +204,7 @@ void gnc_gui_component_watch_entity (gint component_id,
*/
void gnc_gui_component_watch_entity_direct (gint component_id,
GUID entity,
GNCEngineEventType event_mask);
QofEventId event_mask);
/* gnc_gui_component_watch_entity_type
* Watch all entities of a particular type.
@ -217,7 +217,7 @@ void gnc_gui_component_watch_entity_direct (gint component_id,
*/
void gnc_gui_component_watch_entity_type (gint component_id,
GNCIdTypeConst entity_type,
GNCEngineEventType event_mask);
QofEventId event_mask);
/* gnc_gui_get_entity_events
* Return the event info of the events which have been generated by

View File

@ -131,7 +131,7 @@ pgendEventsPending (QofBackend *bend)
typedef struct _event {
Timespec stamp;
GNCEngineEventType type;
QofEventId type;
GUID guid;
QofIdType obj_type;
} Event;
@ -145,7 +145,7 @@ get_event_cb (PGBackend *be, PGresult *result, int j, gpointer data)
Event *ev = NULL;
GUID guid;
Timespec ts;
GNCEngineEventType type;
QofEventId type;
char change = (DB_GET_VAL("change",j))[0];
char objtype = (DB_GET_VAL("objtype",j))[0];
QofIdType obj_type = GNC_ID_NONE;
@ -156,9 +156,9 @@ get_event_cb (PGBackend *be, PGresult *result, int j, gpointer data)
/* convert from SQL type to engine type */
switch (change)
{
case 'a': type = GNC_EVENT_CREATE; break;
case 'm': type = GNC_EVENT_MODIFY; break;
case 'd': type = GNC_EVENT_DESTROY; break;
case 'a': type = QOF_EVENT_CREATE; break;
case 'm': type = QOF_EVENT_MODIFY; break;
case 'd': type = QOF_EVENT_DESTROY; break;
default:
PERR ("unknown change type %c for guid=%s", change, guid_str);
return data;
@ -287,8 +287,8 @@ pgendProcessEvents (QofBackend *bend)
default:
PERR ("account: cant' happen !!!!!!!");
break;
case GNC_EVENT_CREATE:
case GNC_EVENT_MODIFY: {
case QOF_EVENT_CREATE:
case QOF_EVENT_MODIFY: {
Account *acc;
/* if the remote user created an account, mirror it here */
@ -297,7 +297,7 @@ pgendProcessEvents (QofBackend *bend)
ent = (QofEntity*)acc;
break;
}
case GNC_EVENT_DESTROY: {
case QOF_EVENT_DESTROY: {
Account * acc = pgendAccountLookup (be, &(ev->guid));
AccountGroup *topgrp = xaccAccountGetRoot(acc);
xaccAccountBeginEdit (acc);
@ -320,7 +320,7 @@ pgendProcessEvents (QofBackend *bend)
default:
PERR ("transaction: cant' happen !!!!!!!");
break;
case GNC_EVENT_CREATE: {
case QOF_EVENT_CREATE: {
Transaction *trans;
/* don't mirror transaction creations. If a register needs
* it, it will do a query. */
@ -329,14 +329,14 @@ pgendProcessEvents (QofBackend *bend)
PINFO ("create transaction");
break;
}
case GNC_EVENT_MODIFY: {
case QOF_EVENT_MODIFY: {
Transaction *trans;
trans = pgendTransLookup (be, &(ev->guid));
pgendCopyTransactionToEngine (be, &(ev->guid));
ent = (QofEntity*)trans;
break;
}
case GNC_EVENT_DESTROY: {
case QOF_EVENT_DESTROY: {
Transaction *trans = pgendTransLookup (be, &(ev->guid));
xaccTransBeginEdit (trans);
/* mark trans for freeing */
@ -375,7 +375,7 @@ pgendProcessEvents (QofBackend *bend)
local_obj_type = pgendGUIDType (be, &(ev->guid));
if (GNC_ID_NONE != local_obj_type)
{
gnc_engine_gen_event(ent, GNC_EVENT_CREATE);
qof_event_gen(ent, QOF_EVENT_CREATE, NULL);
}
}
else
@ -383,11 +383,11 @@ pgendProcessEvents (QofBackend *bend)
local_obj_type = pgendGUIDType (be, &(ev->guid));
if (GNC_ID_NONE != local_obj_type)
{
gnc_engine_gen_event(ent, GNC_EVENT_MODIFY);
qof_event_gen(ent, QOF_EVENT_MODIFY, NULL);
}
else
{
gnc_engine_gen_event(ent, GNC_EVENT_DESTROY);
qof_event_gen(ent, QOF_EVENT_DESTROY, NULL);
}
}

View File

@ -57,7 +57,7 @@ void mark_address (GncAddress *address)
{
address->dirty = TRUE;
gnc_engine_gen_event (address->parent, GNC_EVENT_MODIFY);
qof_event_gen (address->parent, QOF_EVENT_MODIFY, NULL);
}
/* Create/Destroy functions */

View File

@ -86,7 +86,7 @@ mark_term (GncBillTerm *term)
{
term->inst.dirty = TRUE;
qof_collection_mark_dirty (term->inst.entity.collection);
gnc_engine_gen_event (&term->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&term->inst.entity, QOF_EVENT_MODIFY, NULL);
}
static inline void maybe_resort_list (GncBillTerm *term)
@ -141,7 +141,7 @@ GncBillTerm * gncBillTermCreate (QofBook *book)
term->desc = CACHE_INSERT ("");
term->discount = gnc_numeric_zero ();
addObj (term);
gnc_engine_gen_event (&term->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&term->inst.entity, QOF_EVENT_CREATE, NULL);
return term;
}
@ -162,7 +162,7 @@ static void gncBillTermFree (GncBillTerm *term)
if (!term) return;
gnc_engine_gen_event (&term->inst.entity, GNC_EVENT_DESTROY);
qof_event_gen (&term->inst.entity, QOF_EVENT_DESTROY, NULL);
CACHE_REMOVE (term->name);
CACHE_REMOVE (term->desc);
remObj (term);
@ -229,7 +229,7 @@ gncCloneBillTerm (GncBillTerm *from, QofBook *book)
}
addObj (term);
gnc_engine_gen_event (&term->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&term->inst.entity, QOF_EVENT_CREATE, NULL);
return term;
}

View File

@ -80,7 +80,7 @@ void mark_customer (GncCustomer *customer)
{
customer->inst.dirty = TRUE;
qof_collection_mark_dirty (customer->inst.entity.collection);
gnc_engine_gen_event (&customer->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&customer->inst.entity, QOF_EVENT_MODIFY, NULL);
}
/* ============================================================== */
@ -107,7 +107,7 @@ GncCustomer *gncCustomerCreate (QofBook *book)
cust->credit = gnc_numeric_zero();
cust->shipaddr = gncAddressCreate (book, &cust->inst.entity);
gnc_engine_gen_event (&cust->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&cust->inst.entity, QOF_EVENT_CREATE, NULL);
return cust;
}
@ -151,7 +151,7 @@ gncCloneCustomer (GncCustomer *from, QofBook *book)
cust->jobs = g_list_prepend(cust->jobs, job);
}
gnc_engine_gen_event (&cust->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&cust->inst.entity, QOF_EVENT_CREATE, NULL);
return cust;
}
@ -168,7 +168,7 @@ static void gncCustomerFree (GncCustomer *cust)
{
if (!cust) return;
gnc_engine_gen_event (&cust->inst.entity, GNC_EVENT_DESTROY);
qof_event_gen (&cust->inst.entity, QOF_EVENT_DESTROY, NULL);
CACHE_REMOVE (cust->id);
CACHE_REMOVE (cust->name);
@ -341,7 +341,7 @@ void gncCustomerAddJob (GncCustomer *cust, GncJob *job)
cust->jobs = g_list_insert_sorted (cust->jobs, job,
(GCompareFunc)gncJobCompare);
gnc_engine_gen_event (&cust->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&cust->inst.entity, QOF_EVENT_MODIFY, NULL);
}
void gncCustomerRemoveJob (GncCustomer *cust, GncJob *job)
@ -358,7 +358,7 @@ void gncCustomerRemoveJob (GncCustomer *cust, GncJob *job)
cust->jobs = g_list_remove_link (cust->jobs, node);
g_list_free_1 (node);
}
gnc_engine_gen_event (&cust->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&cust->inst.entity, QOF_EVENT_MODIFY, NULL);
}
void gncCustomerBeginEdit (GncCustomer *cust)

View File

@ -63,7 +63,7 @@ void mark_employee (GncEmployee *employee)
{
employee->inst.dirty = TRUE;
qof_collection_mark_dirty (employee->inst.entity.collection);
gnc_engine_gen_event (&employee->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&employee->inst.entity, QOF_EVENT_MODIFY, NULL);
}
/* ============================================================== */
@ -87,7 +87,7 @@ GncEmployee *gncEmployeeCreate (QofBook *book)
employee->rate = gnc_numeric_zero();
employee->active = TRUE;
gnc_engine_gen_event (&employee->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&employee->inst.entity, QOF_EVENT_CREATE, NULL);
return employee;
}
@ -103,7 +103,7 @@ static void gncEmployeeFree (GncEmployee *employee)
{
if (!employee) return;
gnc_engine_gen_event (&employee->inst.entity, GNC_EVENT_DESTROY);
qof_event_gen (&employee->inst.entity, QOF_EVENT_DESTROY, NULL);
CACHE_REMOVE (employee->id);
CACHE_REMOVE (employee->username);
@ -137,7 +137,7 @@ gncCloneEmployee (GncEmployee *from, QofBook *book)
employee->ccard_acc =
GNC_ACCOUNT(qof_instance_lookup_twin(QOF_INSTANCE(from->ccard_acc), book));
gnc_engine_gen_event (&employee->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&employee->inst.entity, QOF_EVENT_CREATE, NULL);
return employee;
}

View File

@ -170,7 +170,7 @@ void mark_entry (GncEntry *entry)
{
entry->inst.dirty = TRUE;
qof_collection_mark_dirty (entry->inst.entity.collection);
gnc_engine_gen_event (&entry->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&entry->inst.entity, QOF_EVENT_MODIFY, NULL);
}
/* ================================================================ */
@ -204,7 +204,7 @@ GncEntry *gncEntryCreate (QofBook *book)
entry->values_dirty = TRUE;
gnc_engine_gen_event (&entry->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&entry->inst.entity, QOF_EVENT_CREATE, NULL);
return entry;
}
@ -220,7 +220,7 @@ static void gncEntryFree (GncEntry *entry)
{
if (!entry) return;
gnc_engine_gen_event (&entry->inst.entity, GNC_EVENT_DESTROY);
qof_event_gen (&entry->inst.entity, QOF_EVENT_DESTROY, NULL);
CACHE_REMOVE (entry->desc);
CACHE_REMOVE (entry->action);
@ -560,8 +560,8 @@ void gncEntrySetOrder (GncEntry *entry, GncOrder *order)
/* Generate an event modifying the Order's end-owner */
#if 0
gnc_engine_gen_event (gncOwnerGetEndGUID (gncOrderGetOwner (order)),
GNC_EVENT_MODIFY);
qof_event_gen (gncOwnerGetEndGUID (gncOrderGetOwner (order)),
QOF_EVENT_MODIFY, NULL);
#endif
}

View File

@ -92,7 +92,7 @@ mark_invoice (GncInvoice *invoice)
{
invoice->inst.dirty = TRUE;
qof_collection_mark_dirty (invoice->inst.entity.collection);
gnc_engine_gen_event (&invoice->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&invoice->inst.entity, QOF_EVENT_MODIFY, NULL);
}
/* ================================================================== */
@ -116,7 +116,7 @@ GncInvoice *gncInvoiceCreate (QofBook *book)
invoice->to_charge_amount = gnc_numeric_zero();
gnc_engine_gen_event (&invoice->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&invoice->inst.entity, QOF_EVENT_CREATE, NULL);
return invoice;
}
@ -132,7 +132,7 @@ static void gncInvoiceFree (GncInvoice *invoice)
{
if (!invoice) return;
gnc_engine_gen_event (&invoice->inst.entity, GNC_EVENT_DESTROY);
qof_event_gen (&invoice->inst.entity, QOF_EVENT_DESTROY, NULL);
CACHE_REMOVE (invoice->id);
CACHE_REMOVE (invoice->notes);
@ -195,7 +195,7 @@ XXX not done */
GNCLot * posted_lot;
#endif
gnc_engine_gen_event (&invoice->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&invoice->inst.entity, QOF_EVENT_CREATE, NULL);
return invoice;
}
@ -1381,7 +1381,7 @@ gncOwnerApplyPayment (GncOwner *owner, GncInvoice* invoice,
/* Now send an event for the invoice so it gets updated as paid */
this_invoice = gncInvoiceGetInvoiceFromLot(lot);
if (this_invoice)
gnc_engine_gen_event (&this_invoice->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&this_invoice->inst.entity, QOF_EVENT_MODIFY, NULL);
if (gnc_numeric_zero_p (amount))
break;

View File

@ -58,7 +58,7 @@ void mark_job (GncJob *job)
{
job->inst.dirty = TRUE;
qof_collection_mark_dirty (job->inst.entity.collection);
gnc_engine_gen_event (&job->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&job->inst.entity, QOF_EVENT_MODIFY, NULL);
}
/* ================================================================== */
@ -79,7 +79,7 @@ GncJob *gncJobCreate (QofBook *book)
job->active = TRUE;
/* GncOwner not initialized */
gnc_engine_gen_event (&job->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&job->inst.entity, QOF_EVENT_CREATE, NULL);
return job;
}
@ -102,7 +102,7 @@ gncCloneJob (GncJob *from, QofBook *book)
job->owner = gncCloneOwner(&from->owner, book);
gnc_engine_gen_event (&job->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&job->inst.entity, QOF_EVENT_CREATE, NULL);
return job;
}
@ -118,7 +118,7 @@ static void gncJobFree (GncJob *job)
{
if (!job) return;
gnc_engine_gen_event (&job->inst.entity, GNC_EVENT_DESTROY);
qof_event_gen (&job->inst.entity, QOF_EVENT_DESTROY, NULL);
CACHE_REMOVE (job->id);
CACHE_REMOVE (job->name);

View File

@ -72,7 +72,7 @@ void mark_order (GncOrder *order)
{
order->inst.dirty = TRUE;
qof_collection_mark_dirty (order->inst.entity.collection);
gnc_engine_gen_event (&order->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&order->inst.entity, QOF_EVENT_MODIFY, NULL);
}
/* =============================================================== */
@ -93,7 +93,7 @@ GncOrder *gncOrderCreate (QofBook *book)
order->active = TRUE;
gnc_engine_gen_event (&order->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&order->inst.entity, QOF_EVENT_CREATE, NULL);
return order;
}
@ -109,7 +109,7 @@ static void gncOrderFree (GncOrder *order)
{
if (!order) return;
gnc_engine_gen_event (&order->inst.entity, GNC_EVENT_DESTROY);
qof_event_gen (&order->inst.entity, QOF_EVENT_DESTROY, NULL);
g_list_free (order->entries);
CACHE_REMOVE (order->id);
@ -153,7 +153,7 @@ gncCloneOrder (GncOrder *from, QofBook *book)
order->entries = g_list_prepend (order->entries, entry);
}
gnc_engine_gen_event (&order->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&order->inst.entity, QOF_EVENT_CREATE, NULL);
return order;
}

View File

@ -145,7 +145,7 @@ mark_table (GncTaxTable *table)
{
table->inst.dirty = TRUE;
qof_collection_mark_dirty (table->inst.entity.collection);
gnc_engine_gen_event (&table->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&table->inst.entity, QOF_EVENT_MODIFY, NULL);
}
static inline void
@ -213,7 +213,7 @@ gncTaxTableCreate (QofBook *book)
qof_instance_init (&table->inst, _GNC_MOD_NAME, book);
table->name = CACHE_INSERT ("");
addObj (table);
gnc_engine_gen_event (&table->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&table->inst.entity, QOF_EVENT_CREATE, NULL);
return table;
}
@ -265,7 +265,7 @@ gncCloneTaxTable (GncTaxTable *from, QofBook *book)
}
addObj (table);
gnc_engine_gen_event (&table->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&table->inst.entity, QOF_EVENT_CREATE, NULL);
return table;
}
@ -301,7 +301,7 @@ gncTaxTableFree (GncTaxTable *table)
if (!table) return;
gnc_engine_gen_event (&table->inst.entity, GNC_EVENT_DESTROY);
qof_event_gen (&table->inst.entity, QOF_EVENT_DESTROY, NULL);
CACHE_REMOVE (table->name);
remObj (table);

View File

@ -69,7 +69,7 @@ void mark_vendor (GncVendor *vendor)
{
vendor->inst.dirty = TRUE;
qof_collection_mark_dirty (vendor->inst.entity.collection);
gnc_engine_gen_event (&vendor->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&vendor->inst.entity, QOF_EVENT_MODIFY, NULL);
}
/* ============================================================== */
@ -92,7 +92,7 @@ GncVendor *gncVendorCreate (QofBook *book)
vendor->active = TRUE;
vendor->jobs = NULL;
gnc_engine_gen_event (&vendor->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&vendor->inst.entity, QOF_EVENT_CREATE, NULL);
return vendor;
}
@ -108,7 +108,7 @@ static void gncVendorFree (GncVendor *vendor)
{
if (!vendor) return;
gnc_engine_gen_event (&vendor->inst.entity, GNC_EVENT_DESTROY);
qof_event_gen (&vendor->inst.entity, QOF_EVENT_DESTROY, NULL);
CACHE_REMOVE (vendor->id);
CACHE_REMOVE (vendor->name);
@ -162,7 +162,7 @@ gncCloneVendor (GncVendor *from, QofBook *book)
vendor->jobs = g_list_prepend(vendor->jobs, job);
}
gnc_engine_gen_event (&vendor->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&vendor->inst.entity, QOF_EVENT_CREATE, NULL);
return vendor;
}
@ -397,7 +397,7 @@ void gncVendorAddJob (GncVendor *vendor, GncJob *job)
vendor->jobs = g_list_insert_sorted (vendor->jobs, job,
(GCompareFunc)gncJobCompare);
gnc_engine_gen_event (&vendor->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&vendor->inst.entity, QOF_EVENT_MODIFY, NULL);
}
void gncVendorRemoveJob (GncVendor *vendor, GncJob *job)
@ -415,7 +415,7 @@ void gncVendorRemoveJob (GncVendor *vendor, GncJob *job)
g_list_free_1 (node);
}
gnc_engine_gen_event (&vendor->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&vendor->inst.entity, QOF_EVENT_MODIFY, NULL);
}
void gncVendorBeginEdit (GncVendor *vendor)

View File

@ -513,7 +513,7 @@ make_generic_optionmenu (GtkWidget *omenu, GNCBook *book,
if (type_name)
gnc_gui_component_watch_entity_type (omd->component_id,
type_name,
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
g_signal_connect (G_OBJECT (omenu), "destroy",
G_CALLBACK (generic_omenu_destroy_cb), omd);

View File

@ -544,7 +544,7 @@ billterms_window_refresh (BillTermsWindow *btw)
gnc_gui_component_watch_entity (btw->component_id,
gncBillTermGetGUID (term),
GNC_EVENT_MODIFY);
QOF_EVENT_MODIFY);
row_text[0] = (char *)gncBillTermGetName (term);
row_text[1] = NULL;
@ -558,7 +558,7 @@ billterms_window_refresh (BillTermsWindow *btw)
gnc_gui_component_watch_entity_type (btw->component_id,
GNC_BILLTERM_MODULE_NAME,
GNC_EVENT_CREATE | GNC_EVENT_DESTROY);
QOF_EVENT_CREATE | QOF_EVENT_DESTROY);
if (vadjustment) {
save_value = CLAMP (save_value, vadjustment->lower,

View File

@ -405,7 +405,7 @@ gnc_customer_window_refresh_handler (GHashTable *changes, gpointer user_data)
/* Next, close if this is a destroy event */
if (changes) {
info = gnc_gui_get_entity_events (changes, &cw->customer_guid);
if (info && (info->event_mask & GNC_EVENT_DESTROY)) {
if (info && (info->event_mask & QOF_EVENT_DESTROY)) {
gnc_close_gui_component (cw->component_id);
return;
}
@ -620,7 +620,7 @@ gnc_customer_new_window (GNCBook *bookp, GncCustomer *cust)
gnc_gui_component_watch_entity_type (cw->component_id,
GNC_CUSTOMER_MODULE_NAME,
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
gtk_widget_show_all (cw->dialog);

View File

@ -356,7 +356,7 @@ gnc_employee_window_refresh_handler (GHashTable *changes, gpointer user_data)
/* Next, close if this is a destroy event */
if (changes) {
info = gnc_gui_get_entity_events (changes, &ew->employee_guid);
if (info && (info->event_mask & GNC_EVENT_DESTROY)) {
if (info && (info->event_mask & QOF_EVENT_DESTROY)) {
gnc_close_gui_component (ew->component_id);
return;
}
@ -556,7 +556,7 @@ gnc_employee_new_window (GNCBook *bookp,
gnc_gui_component_watch_entity_type (ew->component_id,
GNC_EMPLOYEE_MODULE_NAME,
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
gtk_widget_show_all (ew->dialog);

View File

@ -1304,7 +1304,7 @@ gnc_invoice_window_refresh_handler (GHashTable *changes, gpointer user_data)
/* Next, close if this is a destroy event */
if (changes) {
info = gnc_gui_get_entity_events (changes, &iw->invoice_guid);
if (info && (info->event_mask & GNC_EVENT_DESTROY)) {
if (info && (info->event_mask & QOF_EVENT_DESTROY)) {
gnc_close_gui_component (iw->component_id);
return;
}
@ -1927,7 +1927,7 @@ gnc_invoice_create_page (InvoiceWindow *iw, gpointer page)
gnc_gui_component_watch_entity_type (iw->component_id,
GNC_INVOICE_MODULE_NAME,
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
/* Create the register */
{
@ -2067,7 +2067,7 @@ gnc_invoice_window_new_invoice (GNCBook *bookp, GncOwner *owner,
gnc_gui_component_watch_entity_type (iw->component_id,
GNC_INVOICE_MODULE_NAME,
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
/* Now fill in a lot of the pieces and display properly */
gnc_ui_billterms_optionmenu (iw->terms_menu, iw->book, TRUE, &iw->terms);

View File

@ -269,7 +269,7 @@ gnc_job_window_refresh_handler (GHashTable *changes, gpointer user_data)
/* Next, close if this is a destroy event */
if (changes) {
info = gnc_gui_get_entity_events (changes, &jw->job_guid);
if (info && (info->event_mask & GNC_EVENT_DESTROY)) {
if (info && (info->event_mask & QOF_EVENT_DESTROY)) {
gnc_close_gui_component (jw->component_id);
return;
}
@ -378,7 +378,7 @@ gnc_job_new_window (GNCBook *bookp, GncOwner *owner, GncJob *job)
gnc_job_name_changed_cb (NULL, jw);
gnc_gui_component_watch_entity_type (jw->component_id,
GNC_JOB_MODULE_NAME,
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
gtk_widget_show_all (jw->dialog);

View File

@ -396,7 +396,7 @@ gnc_order_window_refresh_handler (GHashTable *changes, gpointer user_data)
/* Next, close if this is a destroy event */
if (changes) {
info = gnc_gui_get_entity_events (changes, &ow->order_guid);
if (info && (info->event_mask & GNC_EVENT_DESTROY)) {
if (info && (info->event_mask & QOF_EVENT_DESTROY)) {
gnc_close_gui_component (ow->component_id);
return;
}
@ -480,7 +480,7 @@ gnc_order_update_window (OrderWindow *ow)
gnc_gui_component_watch_entity_type (ow->component_id,
GNC_ORDER_MODULE_NAME,
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
gnc_table_refresh_gui (gnc_entry_ledger_get_table (ow->ledger), TRUE);

View File

@ -437,8 +437,8 @@ new_payment_window (GncOwner *owner, GNCBook *book, GncInvoice *invoice)
/* Watch for any new or changed accounts */
gnc_gui_component_watch_entity_type (pw->component_id,
GNC_ID_ACCOUNT,
GNC_EVENT_CREATE | GNC_EVENT_MODIFY |
GNC_EVENT_DESTROY);
QOF_EVENT_CREATE | QOF_EVENT_MODIFY |
QOF_EVENT_DESTROY);
/* Fill in the post_combo and account_tree widgets */
gnc_fill_account_select_combo (pw->post_combo, pw->book, pw->acct_types);

View File

@ -327,7 +327,7 @@ gnc_vendor_window_refresh_handler (GHashTable *changes, gpointer user_data)
/* Next, close if this is a destroy event */
if (changes) {
info = gnc_gui_get_entity_events (changes, &vw->vendor_guid);
if (info && (info->event_mask & GNC_EVENT_DESTROY)) {
if (info && (info->event_mask & QOF_EVENT_DESTROY)) {
gnc_close_gui_component (vw->component_id);
return;
}
@ -487,7 +487,7 @@ gnc_vendor_new_window (GNCBook *bookp, GncVendor *vendor)
gnc_gui_component_watch_entity_type (vw->component_id,
GNC_VENDOR_MODULE_NAME,
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
gtk_widget_show_all (vw->dialog);

View File

@ -90,7 +90,7 @@ gnc_entry_ledger_set_watches (GncEntryLedger *ledger, GList *entries)
gnc_gui_component_watch_entity (ledger->component_id,
gncOwnerGetGUID
(gncInvoiceGetOwner (ledger->invoice)),
GNC_EVENT_MODIFY);
QOF_EVENT_MODIFY);
case GNCENTRY_INVOICE_VIEWER:
case GNCENTRY_BILL_ENTRY:
case GNCENTRY_BILL_VIEWER:
@ -106,17 +106,17 @@ gnc_entry_ledger_set_watches (GncEntryLedger *ledger, GList *entries)
gnc_gui_component_watch_entity_type (ledger->component_id,
type,
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
/* To make sure the xfer cell is up to date */
gnc_gui_component_watch_entity_type (ledger->component_id,
GNC_ID_ACCOUNT,
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
/* To make sure the taxtable cell is up to date */
gnc_gui_component_watch_entity_type (ledger->component_id,
GNC_TAXTABLE_MODULE_NAME,
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
/* For expense vouchers, watch the employee and refresh if it's changed */
if (ledger->type == GNCENTRY_EXPVOUCHER_ENTRY) {
@ -126,7 +126,7 @@ gnc_entry_ledger_set_watches (GncEntryLedger *ledger, GList *entries)
if (employee)
gnc_gui_component_watch_entity (ledger->component_id,
gncEmployeeGetGUID (employee),
GNC_EVENT_MODIFY);
QOF_EVENT_MODIFY);
}
for (node = entries; node; node = node->next)
@ -134,7 +134,7 @@ gnc_entry_ledger_set_watches (GncEntryLedger *ledger, GList *entries)
GncEntry *entry = node->data;
gnc_gui_component_watch_entity (ledger->component_id,
gncEntryGetGUID (entry),
GNC_EVENT_MODIFY);
QOF_EVENT_MODIFY);
}
}

View File

@ -453,7 +453,7 @@ tax_table_window_refresh (TaxTableWindow *ttw)
gnc_gui_component_watch_entity (ttw->component_id,
gncTaxTableGetGUID (table),
GNC_EVENT_MODIFY);
QOF_EVENT_MODIFY);
row_text[0] = (char *)gncTaxTableGetName (table);
row_text[1] = NULL;
@ -467,7 +467,7 @@ tax_table_window_refresh (TaxTableWindow *ttw)
gnc_gui_component_watch_entity_type (ttw->component_id,
GNC_TAXTABLE_MODULE_NAME,
GNC_EVENT_CREATE | GNC_EVENT_DESTROY);
QOF_EVENT_CREATE | QOF_EVENT_DESTROY);
if (vadjustment) {
save_value = CLAMP (save_value, vadjustment->lower,

View File

@ -159,7 +159,7 @@ xaccMallocAccount (QofBook *book)
acc = g_new (Account, 1);
xaccInitAccount (acc, book);
gnc_engine_gen_event (&acc->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&acc->inst.entity, QOF_EVENT_CREATE, NULL);
return acc;
}
@ -228,7 +228,7 @@ xaccFreeAccount (Account *acc)
if (!acc) return;
gnc_engine_gen_event (&acc->inst.entity, GNC_EVENT_DESTROY);
qof_event_gen (&acc->inst.entity, QOF_EVENT_DESTROY, NULL);
if (acc->children)
{
@ -317,7 +317,7 @@ xaccAccountBeginEdit (Account *acc)
static inline void on_done(QofInstance *inst)
{
/* old event style */
gnc_engine_gen_event (&inst->entity, GNC_EVENT_MODIFY);
qof_event_gen (&inst->entity, QOF_EVENT_MODIFY, NULL);
}
static inline void on_err (QofInstance *inst, QofBackendError errcode)
@ -939,7 +939,6 @@ xaccAccountRecomputeBalance (Account * acc)
acc->balance_dirty = FALSE;
gnc_engine_gen_event (&acc->inst.entity, GNC_EVENT_MODIFY);
}
/********************************************************************\

View File

@ -189,7 +189,7 @@ xaccFreqSpecMalloc(QofBook *book)
fs = g_new0(FreqSpec, 1);
xaccFreqSpecInit( fs, book );
gnc_engine_gen_event( &fs->entity, GNC_EVENT_CREATE );
qof_event_gen( &fs->entity, QOF_EVENT_CREATE , NULL);
return fs;
}
@ -220,7 +220,7 @@ void
xaccFreqSpecFree( FreqSpec *fs )
{
if ( fs == NULL ) return;
gnc_engine_gen_event( &fs->entity, GNC_EVENT_DESTROY );
qof_event_gen( &fs->entity, QOF_EVENT_DESTROY , NULL);
xaccFreqSpecCleanUp( fs );
qof_entity_release (&fs->entity);

View File

@ -618,7 +618,7 @@ xaccAccountRemoveGroup (Account *acc)
grp->saved = 0;
gnc_engine_gen_event (&acc->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&acc->inst.entity, QOF_EVENT_MODIFY, NULL);
}
/********************************************************************\
@ -662,7 +662,7 @@ xaccGroupRemoveAccount (AccountGroup *grp, Account *acc)
xaccFreeAccountGroup (grp);
}
gnc_engine_gen_event (&acc->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&acc->inst.entity, QOF_EVENT_MODIFY, NULL);
}
/********************************************************************\
@ -685,7 +685,7 @@ xaccAccountInsertSubAccount (Account *adult, Account *child)
xaccGroupInsertAccount (adult->children, child);
gnc_engine_gen_event (&adult->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&adult->inst.entity, QOF_EVENT_MODIFY, NULL);
}
/********************************************************************\
@ -742,10 +742,10 @@ xaccGroupInsertAccount (AccountGroup *grp, Account *acc)
*/
PWARN ("reparenting accounts across books is not correctly supported\n");
gnc_engine_gen_event (&acc->inst.entity, GNC_EVENT_DESTROY);
qof_event_gen (&acc->inst.entity, QOF_EVENT_DESTROY, NULL);
col = qof_book_get_collection (grp->book, GNC_ID_ACCOUNT);
qof_collection_insert_entity (col, &acc->inst.entity);
gnc_engine_gen_event (&acc->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&acc->inst.entity, QOF_EVENT_CREATE, NULL);
}
}
@ -764,7 +764,7 @@ xaccGroupInsertAccount (AccountGroup *grp, Account *acc)
grp->saved = 0;
gnc_engine_gen_event (&acc->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&acc->inst.entity, QOF_EVENT_MODIFY, NULL);
LEAVE(" ");
}
@ -833,7 +833,7 @@ xaccGroupCopyGroup (AccountGroup *to, AccountGroup *from)
xaccGroupCopyGroup (to_acc->children, from_acc->children);
}
xaccAccountCommitEdit (to_acc);
gnc_engine_gen_event (&to_acc->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&to_acc->inst.entity, QOF_EVENT_CREATE, NULL);
/* make sure that we have a symmetric, uniform number of
* begin-edits, so that subsequent GroupCommitEdit's
@ -893,14 +893,14 @@ xaccGroupMergeAccounts (AccountGroup *grp)
gb->parent = acc_a;
acc_b->children = NULL;
gnc_engine_gen_event (&acc_a->inst.entity, GNC_EVENT_MODIFY);
gnc_engine_gen_event (&acc_b->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&acc_a->inst.entity, QOF_EVENT_MODIFY, NULL);
qof_event_gen (&acc_b->inst.entity, QOF_EVENT_MODIFY, NULL);
}
else
{
xaccGroupConcatGroup (ga, gb);
acc_b->children = NULL;
gnc_engine_gen_event (&acc_b->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&acc_b->inst.entity, QOF_EVENT_MODIFY, NULL);
}
}
@ -914,8 +914,8 @@ xaccGroupMergeAccounts (AccountGroup *grp)
{
Split *split = lp->data;
gnc_engine_gen_event (&xaccSplitGetAccount(split)->inst.entity,
GNC_EVENT_MODIFY);
qof_event_gen (&xaccSplitGetAccount(split)->inst.entity,
QOF_EVENT_MODIFY, NULL);
split->acc = NULL;
xaccAccountInsertSplit (acc_a, split);
}
@ -927,7 +927,7 @@ xaccGroupMergeAccounts (AccountGroup *grp)
node_b = node_b->prev;
/* remove from list -- node_a is ok, it's before node_b */
gnc_engine_gen_event (&acc_b->inst.entity, GNC_EVENT_REMOVE);
qof_event_gen (&acc_b->inst.entity, QOF_EVENT_REMOVE, NULL);
grp->accounts = g_list_remove (grp->accounts, acc_b);
xaccAccountBeginEdit (acc_b);

View File

@ -118,7 +118,7 @@ gnc_book_insert_trans_clobber (QofBook *book, Transaction *trans)
}
xaccTransCommitEdit (newtrans);
gnc_engine_gen_event (&newtrans->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&newtrans->inst.entity, QOF_EVENT_CREATE, NULL);
LEAVE ("trans=%p %s", trans, trans->description);
}
@ -186,7 +186,7 @@ gnc_book_insert_trans (QofBook *book, Transaction *trans)
}
xaccTransCommitEdit (trans);
gnc_engine_gen_event (&trans->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&trans->inst.entity, QOF_EVENT_MODIFY, NULL);
LEAVE ("trans=%p %s", trans, trans->description);
}

View File

@ -92,7 +92,7 @@ xaccSchedXactionMalloc(QofBook *book)
sx = g_new0( SchedXaction, 1 );
xaccSchedXactionInit( sx, book );
gnc_engine_gen_event( &sx->inst.entity, GNC_EVENT_CREATE );
qof_event_gen( &sx->inst.entity, QOF_EVENT_CREATE , NULL);
return sx;
}
@ -146,7 +146,7 @@ xaccSchedXactionFree( SchedXaction *sx )
if ( sx == NULL ) return;
xaccFreqSpecFree( sx->freq );
gnc_engine_gen_event( &sx->inst.entity, GNC_EVENT_DESTROY );
qof_event_gen( &sx->inst.entity, QOF_EVENT_DESTROY , NULL);
if ( sx->name )
g_free( sx->name );

View File

@ -516,7 +516,7 @@ xaccSplitCommitEdit(Split *s)
//FIXME: probably not needed.
xaccGroupMarkNotSaved (orig_acc->parent);
//FIXME: find better event type
gnc_engine_gen_event (&orig_acc->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&orig_acc->inst.entity, QOF_EVENT_MODIFY, NULL);
} else PERR("Account lost track of moved or deleted split.");
orig_acc->balance_dirty = TRUE;
xaccAccountRecomputeBalance(orig_acc);
@ -540,7 +540,7 @@ xaccSplitCommitEdit(Split *s)
xaccGroupMarkNotSaved (acc->parent); //FIXME: probably not needed.
//FIXME: find better event
gnc_engine_gen_event (&acc->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&acc->inst.entity, QOF_EVENT_MODIFY, NULL);
} else PERR("Account grabbed split prematurely.");
acc->balance_dirty = TRUE;
xaccSplitSetAmount(s, xaccSplitGetAmount(s));
@ -548,11 +548,11 @@ xaccSplitCommitEdit(Split *s)
if (s->orig_parent && s->parent != s->orig_parent) {
//FIXME: find better event
gnc_engine_gen_event (&s->orig_parent->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&s->orig_parent->inst.entity, QOF_EVENT_MODIFY, NULL);
}
if (s->lot) {
/* A change of value/amnt affects gains display, etc. */
gnc_engine_gen_event (&s->lot->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&s->lot->inst.entity, QOF_EVENT_MODIFY, NULL);
}
/* Important: we save off the original parent transaction and account

View File

@ -220,16 +220,16 @@ void gen_event_trans (Transaction *trans)
if (account)
{
xaccGroupMarkNotSaved (account->parent);
gnc_engine_gen_event (&account->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&account->inst.entity, QOF_EVENT_MODIFY, NULL);
}
if (lot)
{
/* A change of transaction date might affect opening date of lot */
gnc_engine_gen_event (&lot->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&lot->inst.entity, QOF_EVENT_MODIFY, NULL);
}
}
#endif
gnc_engine_gen_event (&trans->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&trans->inst.entity, QOF_EVENT_MODIFY, NULL);
}
/********************************************************************\
@ -276,7 +276,7 @@ xaccMallocTransaction (QofBook *book)
trans = g_new(Transaction, 1);
xaccInitTransaction (trans, book);
gnc_engine_gen_event (&trans->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&trans->inst.entity, QOF_EVENT_CREATE, NULL);
return trans;
}
@ -889,7 +889,7 @@ do_destroy (Transaction *trans)
if (!shutting_down)
xaccTransWriteLog (trans, 'D');
gnc_engine_gen_event (&trans->inst.entity, GNC_EVENT_DESTROY);
qof_event_gen (&trans->inst.entity, QOF_EVENT_DESTROY, NULL);
/* We only own the splits that still think they belong to us. */
trans->splits = g_list_copy(trans->splits);

View File

@ -65,7 +65,7 @@ gnc_budget_new(QofBook *book)
gnc_budget_set_description(budget, "");
gnc_budget_set_num_periods(budget, 12);
gnc_engine_gen_event( &budget->inst.entity, GNC_EVENT_CREATE );
qof_event_gen( &budget->inst.entity, QOF_EVENT_CREATE , NULL);
LEAVE(" ");
return budget;
@ -83,7 +83,7 @@ gnc_budget_free(GncBudget* budget)
/* We first send the message that this object is about to be
* destroyed so that any GUI elements can remove it before it is
* actually gone. */
gnc_engine_gen_event( &budget->inst.entity, GNC_EVENT_DESTROY);
qof_event_gen( &budget->inst.entity, QOF_EVENT_DESTROY, NULL);
CACHE_REMOVE(budget->name);
CACHE_REMOVE(budget->description);
@ -100,7 +100,7 @@ gnc_budget_set_name(GncBudget* budget, const gchar* name)
CACHE_REPLACE(budget->name, name);
qof_collection_mark_dirty(budget->inst.entity.collection);
gnc_engine_gen_event( &budget->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen( &budget->inst.entity, QOF_EVENT_MODIFY, NULL);
}
const gchar*
@ -119,7 +119,7 @@ gnc_budget_set_description(GncBudget* budget, const gchar* description)
CACHE_REPLACE(budget->description, description);
qof_collection_mark_dirty(budget->inst.entity.collection);
gnc_engine_gen_event( &budget->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen( &budget->inst.entity, QOF_EVENT_MODIFY, NULL);
}
const gchar*
@ -136,7 +136,7 @@ gnc_budget_set_recurrence(GncBudget *budget, const Recurrence *r)
budget->recurrence = *r;
qof_collection_mark_dirty(budget->inst.entity.collection);
gnc_engine_gen_event(&budget->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen(&budget->inst.entity, QOF_EVENT_MODIFY, NULL);
}
const Recurrence *
@ -161,7 +161,7 @@ gnc_budget_set_num_periods(GncBudget* budget, guint num_periods)
budget->num_periods = num_periods;
qof_collection_mark_dirty(budget->inst.entity.collection);
gnc_engine_gen_event( &budget->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen( &budget->inst.entity, QOF_EVENT_MODIFY, NULL);
}
guint
@ -193,7 +193,7 @@ gnc_budget_set_account_period_value(GncBudget *budget, Account *account,
kvp_frame_set_numeric(frame, path, val);
qof_collection_mark_dirty(budget->inst.entity.collection);
gnc_engine_gen_event( &budget->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen( &budget->inst.entity, QOF_EVENT_MODIFY, NULL);
}

View File

@ -475,7 +475,7 @@ mark_commodity_dirty (gnc_commodity *cm)
{
cm->inst.dirty = TRUE; /* No-one uses or clears this flag. */
qof_collection_mark_dirty (cm->inst.entity.collection);
gnc_engine_gen_event (&cm->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&cm->inst.entity, QOF_EVENT_MODIFY, NULL);
}
static void
@ -528,7 +528,7 @@ gnc_commodity_new(QofBook *book, const char * fullname,
reset_printname(retval);
reset_unique_name(retval);
gnc_engine_gen_event (&retval->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&retval->inst.entity, QOF_EVENT_CREATE, NULL);
return retval;
}
@ -543,7 +543,7 @@ gnc_commodity_destroy(gnc_commodity * cm)
{
if(!cm) return;
gnc_engine_gen_event (&cm->inst.entity, GNC_EVENT_DESTROY);
qof_event_gen (&cm->inst.entity, QOF_EVENT_DESTROY, NULL);
/* Set at creation */
CACHE_REMOVE (cm->fullname);
@ -1214,7 +1214,7 @@ gnc_commodity_table_insert(gnc_commodity_table * table,
(gpointer)comm);
nsp->cm_list = g_list_append(nsp->cm_list, comm);
gnc_engine_gen_event (&comm->inst.entity, GNC_EVENT_ADD);
qof_event_gen (&comm->inst.entity, QOF_EVENT_ADD, NULL);
LEAVE ("(table=%p, comm=%p)", table, comm);
return comm;
}
@ -1239,7 +1239,7 @@ gnc_commodity_table_remove(gnc_commodity_table * table,
c = gnc_commodity_table_lookup (table, ns_name, comm->mnemonic);
if (c != comm) return;
gnc_engine_gen_event (&comm->inst.entity, GNC_EVENT_REMOVE);
qof_event_gen (&comm->inst.entity, QOF_EVENT_REMOVE, NULL);
nsp = gnc_commodity_table_find_namespace(table, ns_name);
if (!nsp) return;
@ -1457,13 +1457,13 @@ gnc_commodity_table_add_namespace(gnc_commodity_table * table,
ns->cm_table = g_hash_table_new(g_str_hash, g_str_equal);
ns->name = gnc_string_cache_insert((gpointer)namespace);
qof_instance_init (&ns->inst, GNC_ID_COMMODITY_NAMESPACE, book);
gnc_engine_gen_event (&ns->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&ns->inst.entity, QOF_EVENT_CREATE, NULL);
g_hash_table_insert(table->ns_table,
(gpointer) ns->name,
(gpointer) ns);
table->ns_list = g_list_append(table->ns_list, ns);
gnc_engine_gen_event (&ns->inst.entity, GNC_EVENT_ADD);
qof_event_gen (&ns->inst.entity, QOF_EVENT_ADD, NULL);
}
return ns;
}
@ -1526,7 +1526,7 @@ gnc_commodity_table_delete_namespace(gnc_commodity_table * table,
if (!ns)
return;
gnc_engine_gen_event (&ns->inst.entity, GNC_EVENT_REMOVE);
qof_event_gen (&ns->inst.entity, QOF_EVENT_REMOVE, NULL);
g_hash_table_remove(table->ns_table, namespace);
table->ns_list = g_list_remove(table->ns_list, ns);
@ -1537,7 +1537,7 @@ gnc_commodity_table_delete_namespace(gnc_commodity_table * table,
g_hash_table_destroy(ns->cm_table);
gnc_string_cache_remove(ns->name);
gnc_engine_gen_event (&ns->inst.entity, GNC_EVENT_DESTROY);
qof_event_gen (&ns->inst.entity, QOF_EVENT_DESTROY, NULL);
qof_instance_release(&ns->inst);
g_free(ns);
}

View File

@ -71,7 +71,7 @@ gnc_lot_new (QofBook *book)
lot = g_new (GNCLot, 1);
gnc_lot_init (lot, book);
gnc_engine_gen_event (&lot->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&lot->inst.entity, QOF_EVENT_CREATE, NULL);
return lot;
}
@ -82,7 +82,7 @@ gnc_lot_destroy (GNCLot *lot)
if (!lot) return;
ENTER ("(lot=%p)", lot);
gnc_engine_gen_event (&lot->inst.entity, GNC_EVENT_DESTROY);
qof_event_gen (&lot->inst.entity, QOF_EVENT_DESTROY, NULL);
for (node=lot->splits; node; node=node->next)
@ -262,7 +262,7 @@ gnc_lot_add_split (GNCLot *lot, Split *split)
/* for recomputation of is-closed */
lot->is_closed = -1;
gnc_engine_gen_event (&lot->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&lot->inst.entity, QOF_EVENT_MODIFY, NULL);
}
void
@ -281,7 +281,7 @@ gnc_lot_remove_split (GNCLot *lot, Split *split)
xaccAccountRemoveLot (lot->account, lot);
lot->account = NULL;
}
gnc_engine_gen_event (&lot->inst.entity, GNC_EVENT_MODIFY);
qof_event_gen (&lot->inst.entity, QOF_EVENT_MODIFY, NULL);
}
/* ============================================================== */

View File

@ -56,7 +56,7 @@ gnc_price_create (QofBook *book)
p->source = NULL;
qof_instance_init (&p->inst, GNC_ID_PRICE, book);
gnc_engine_gen_event (&p->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&p->inst.entity, QOF_EVENT_CREATE, NULL);
return p;
}
@ -65,7 +65,7 @@ static void
gnc_price_destroy (GNCPrice *p)
{
ENTER(" ");
gnc_engine_gen_event (&p->inst.entity, GNC_EVENT_DESTROY);
qof_event_gen (&p->inst.entity, QOF_EVENT_DESTROY, NULL);
if(p->type) gnc_string_cache_remove(p->type);
if(p->source) gnc_string_cache_remove(p->source);
@ -827,7 +827,7 @@ add_price(GNCPriceDB *db, GNCPrice *p)
}
g_hash_table_insert(currency_hash, currency, price_list);
p->db = db;
gnc_engine_gen_event (&p->inst.entity, GNC_EVENT_ADD);
qof_event_gen (&p->inst.entity, QOF_EVENT_ADD, NULL);
LEAVE ("db=%p, pr=%p dirty=%d do-free=%d commodity=%s/%s currency_hash=%p",
db, p, p->inst.dirty, p->inst.do_free,
@ -892,7 +892,7 @@ remove_price(GNCPriceDB *db, GNCPrice *p, gboolean cleanup)
currency_hash = g_hash_table_lookup(db->commodity_hash, commodity);
if(!currency_hash) { LEAVE (" no currency hash"); return FALSE; }
gnc_engine_gen_event (&p->inst.entity, GNC_EVENT_REMOVE);
qof_event_gen (&p->inst.entity, QOF_EVENT_REMOVE, NULL);
price_list = g_hash_table_lookup(currency_hash, currency);
gnc_price_ref(p);
if(!gnc_price_list_remove(&price_list, p)) {

View File

@ -109,13 +109,13 @@
(gw:wrap-as-wct ws '<gnc:Query*> "Query *" "const Query *")
(let ((wt (gw:wrap-enumeration ws '<gnc:event-type> "GNCEngineEventType")))
(let ((wt (gw:wrap-enumeration ws '<gnc:event-type> "QofEventId")))
(gw:enum-add-value! wt "GNC_EVENT_NONE" 'gnc-event-none)
(gw:enum-add-value! wt "GNC_EVENT_CREATE" 'gnc-event-create)
(gw:enum-add-value! wt "GNC_EVENT_MODIFY" 'gnc-event-modify)
(gw:enum-add-value! wt "GNC_EVENT_DESTROY" 'gnc-event-destroy)
(gw:enum-add-value! wt "GNC_EVENT_ALL" 'gnc-event-all))
(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))
(let ((wt (gw:wrap-enumeration ws '<gnc:query-op> "QofQueryOp")))
@ -1491,7 +1491,7 @@ argument between 0 and 100 (inclusive).")
ws
'gnc:set-log-level-global
'<gw:void>
"gnc_set_log_level_global"
"qof_log_set_level_registered"
'((<gw:int> level))
"Set the logging level for all modules to level.")
@ -2465,7 +2465,7 @@ the timepair representing midday on that day")
ws
'gnc:engine-suspend-events
'<gw:void>
"gnc_engine_suspend_events"
"qof_event_suspend"
'()
"Suspend all engine events.")
@ -2473,7 +2473,7 @@ the timepair representing midday on that day")
ws
'gnc:engine-resume-events
'<gw:void>
"gnc_engine_resume_events"
"qof_event_resume"
'()
"Resume engine event generation.")

View File

@ -95,7 +95,7 @@ obj_create(QofBook *book)
g->active = TRUE;
g->version = 1;
g->minor = 1;
gnc_engine_gen_event(&g->inst.entity, GNC_EVENT_CREATE);
qof_event_gen(&g->inst.entity, QOF_EVENT_CREATE, NULL);
return g;
}
@ -286,7 +286,7 @@ test_merge (void)
do_test ((NULL != &import_obj->inst), "#4 instance init");
obj_setGUID(import_obj,qof_instance_get_guid(&import_obj->inst));
do_test ((NULL != &import_obj->obj_guid), "#5 guid set");
gnc_engine_gen_event(&import_obj->inst.entity, GNC_EVENT_CREATE);
qof_event_gen(&import_obj->inst.entity, QOF_EVENT_CREATE, NULL);
do_test ((NULL != &import_obj->inst.entity), "#6 gnc event create");
obj_setName(import_obj, import_init);
do_test ((NULL != &import_obj->Name), "#7 string set");
@ -314,7 +314,7 @@ test_merge (void)
new_obj = g_new(myobj, 1);
qof_instance_init (&new_obj->inst, TEST_MODULE_NAME, import);
obj_setGUID(new_obj,qof_instance_get_guid(&new_obj->inst));
gnc_engine_gen_event (&new_obj->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&new_obj->inst.entity, QOF_EVENT_CREATE, NULL);
obj_setName(new_obj, import_init);
obj_setAmount(new_obj, obj_amount);
obj_setActive(new_obj, active);
@ -334,7 +334,7 @@ test_merge (void)
target_obj = g_new(myobj, 1);
qof_instance_init (&target_obj->inst, TEST_MODULE_NAME, target);
obj_setGUID(target_obj,qof_instance_get_guid(&target_obj->inst));
gnc_engine_gen_event (&target_obj->inst.entity, GNC_EVENT_CREATE);
qof_event_gen (&target_obj->inst.entity, QOF_EVENT_CREATE, NULL);
obj_setName(target_obj, target_init);
obj_setAmount(target_obj, obj_amount);
obj_setActive(target_obj, active);

View File

@ -182,7 +182,7 @@ grand_create(QofBook *book)
g->Amount = get_random_gnc_numeric();
g->child = NULL;
g->descend = NULL;
gnc_engine_gen_event(&g->inst.entity, GNC_EVENT_CREATE);
qof_event_gen(&g->inst.entity, QOF_EVENT_CREATE, NULL);
return g;
}
@ -203,7 +203,7 @@ parent_create(QofBook *book)
g->Name = get_random_string();
g->Amount = get_random_gnc_numeric();
g->child = NULL;
gnc_engine_gen_event(&g->inst.entity, GNC_EVENT_CREATE);
qof_event_gen(&g->inst.entity, QOF_EVENT_CREATE, NULL);
return g;
}
@ -223,7 +223,7 @@ child_create(QofBook *book)
g->flag = get_random_character();
g->Name = get_random_string();
g->Amount = get_random_gnc_numeric();
gnc_engine_gen_event(&g->inst.entity, GNC_EVENT_CREATE);
qof_event_gen(&g->inst.entity, QOF_EVENT_CREATE, NULL);
return g;
}

View File

@ -497,7 +497,7 @@ search_new_item_cb (GtkButton *button, GNCSearchWindow *sw)
guid, op);
/* Watch this entity so we'll refresh once it's actually changed */
gnc_gui_component_watch_entity (sw->component_id, guid, GNC_EVENT_MODIFY);
gnc_gui_component_watch_entity (sw->component_id, guid, QOF_EVENT_MODIFY);
}
}

View File

@ -196,7 +196,7 @@ refresh_handler (GHashTable *changes, gpointer data)
if (changes) {
info = gnc_gui_get_entity_events (changes, &priv->guid);
if (info) {
if (info->event_mask & GNC_EVENT_DESTROY)
if (info->event_mask & QOF_EVENT_DESTROY)
gsl->selected_item = NULL;
reset_selection_text (gsl);
}
@ -341,7 +341,7 @@ gnc_general_search_set_selected (GNCGeneralSearch *gsl, gpointer selection)
(gsl->selected_item, get_guid)));
gnc_gui_component_watch_entity
(priv->component_id, &(priv->guid),
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
} else
priv->guid = *xaccGUIDNULL ();
}

View File

@ -71,7 +71,7 @@ shared_quickfill_destroy (QofBook *book, gpointer key, gpointer user_data)
*/
static void
listen_for_account_events (GUID *guid, QofIdType type,
GNCEngineEventType event_type,
QofEventId event_type,
gpointer user_data)
{
QFB *qfb = user_data;
@ -83,7 +83,7 @@ listen_for_account_events (GUID *guid, QofIdType type,
Account *account;
GtkTreeIter iter;
if (! (event_type & GNC_EVENT_MODIFY)) return;
if (! (event_type & QOF_EVENT_MODIFY)) return;
if (QSTRCMP (type, GNC_ID_ACCOUNT)) return;
col = qof_book_get_collection (qfb->book, GNC_ID_ACCOUNT);

View File

@ -1438,7 +1438,7 @@ refresh_handler (GHashTable *changes, gpointer user_data)
if (changes)
{
info = gnc_gui_get_entity_events (changes, &aw->account);
if (info && (info->event_mask & GNC_EVENT_DESTROY))
if (info && (info->event_mask & QOF_EVENT_DESTROY))
{
gnc_close_gui_component (aw->component_id);
return;
@ -1521,7 +1521,7 @@ gnc_ui_new_account_window_internal (Account *base_account,
gnc_gui_component_set_session (aw->component_id, gnc_get_current_session());
gnc_gui_component_watch_entity_type (aw->component_id,
GNC_ID_ACCOUNT,
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
return aw;
}
@ -1712,7 +1712,7 @@ gnc_ui_edit_account_window(Account *account)
gnc_gui_component_set_session (aw->component_id, gnc_get_current_session());
gnc_gui_component_watch_entity_type (aw->component_id,
GNC_ID_ACCOUNT,
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
gtk_window_present(GTK_WINDOW(aw->dialog));
}

View File

@ -159,7 +159,7 @@ gnc_dialog_query_list_refresh_handler (GHashTable *changes, gpointer user_data)
for (node = dql->books; node; node = node->next)
{
info = gnc_gui_get_entity_events (changes, (const GUID*)(node->data));
if (info && (info->event_mask & GNC_EVENT_DESTROY))
if (info && (info->event_mask & QOF_EVENT_DESTROY))
{
gnc_close_gui_component (dql->component_id);
return;
@ -229,7 +229,7 @@ gnc_dialog_query_list_new (GList *param_list, Query *q)
/* and register the books */
for (node = dql->books; node; node = node->next)
gnc_gui_component_watch_entity (dql->component_id, (GUID*)node->data,
GNC_EVENT_DESTROY);
QOF_EVENT_DESTROY);
return dql;
}

View File

@ -55,7 +55,7 @@ static void gas_accounts_to_names (gpointer data, gpointer user_data);
static void gas_populate_list (GNCAccountSel *gas);
static void gas_strcmp_adapter (gpointer a, gpointer b);
static void gnc_account_sel_event_cb (GUID *entity, QofIdType id_type,
GNCEngineEventType event_type,
QofEventId event_type,
gpointer user_data);
static void gas_new_account_click (GtkButton *b, gpointer ud);
@ -98,12 +98,12 @@ gnc_account_sel_get_type (void)
static
void
gnc_account_sel_event_cb( GUID *entity, QofIdType type,
GNCEngineEventType event_type,
QofEventId event_type,
gpointer user_data )
{
if ( ! ( event_type == GNC_EVENT_CREATE
|| event_type == GNC_EVENT_MODIFY
|| event_type == GNC_EVENT_DESTROY )
if ( ! ( event_type == QOF_EVENT_CREATE
|| event_type == QOF_EVENT_MODIFY
|| event_type == QOF_EVENT_DESTROY )
|| strcmp( type, GNC_ID_ACCOUNT ) != 0 ) {
return;
}

View File

@ -991,13 +991,13 @@ gnc_main_window_delete_event (GtkWidget *window,
* function only cares about a type of GNC_ID_BOOK.
*
* @param event_type The type of the event. This function only cares
* about an event type of GNC_EVENT_DESTROY.
* about an event type of QOF_EVENT_DESTROY.
*
* @param user_data A pointer to the window data structure.
*/
static void
gnc_main_window_event_handler (GUID *entity, QofIdType type,
GNCEngineEventType event_type,
QofEventId event_type,
gpointer user_data)
{
GncMainWindow *window;
@ -1011,7 +1011,7 @@ gnc_main_window_event_handler (GUID *entity, QofIdType type,
/* soft failures */
if (safe_strcmp(type, GNC_ID_BOOK) != 0)
return;
if (event_type != GNC_EVENT_DESTROY)
if (event_type != QOF_EVENT_DESTROY)
return;
ENTER("entity %p of type %s, event %d, window %p",

View File

@ -846,7 +846,7 @@ gnc_query_list_fill(GNCQueryList *list)
gup = priv->get_guid;
guid = (const GUID*)((gup->param_getfcn)(item->data, gup));
gnc_gui_component_watch_entity (priv->component_id, guid,
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
list->num_entries++;
}

View File

@ -83,7 +83,7 @@ static gboolean gnc_tree_model_commodity_iter_parent (GtkTreeModel *tree_model,
GtkTreeIter *iter,
GtkTreeIter *child);
static void gnc_tree_model_commodity_event_handler (GUID *entity, QofIdType type,
GNCEngineEventType event_type,
QofEventId event_type,
gpointer user_data);
/** The instance private data for a commodity database tree model. */
@ -1197,7 +1197,7 @@ gnc_tree_model_commodity_do_deletions (gpointer unused)
*/
static void
gnc_tree_model_commodity_event_handler (GUID *entity, QofIdType type,
GNCEngineEventType event_type,
QofEventId event_type,
gpointer user_data)
{
GncTreeModelCommodity *model;
@ -1219,7 +1219,7 @@ gnc_tree_model_commodity_event_handler (GUID *entity, QofIdType type,
commodity = gnc_commodity_find_commodity_by_guid(entity, gnc_get_current_book ());
name = gnc_commodity_get_mnemonic(commodity);
if (event_type != GNC_EVENT_DESTROY) {
if (event_type != QOF_EVENT_DESTROY) {
if (!gnc_tree_model_commodity_get_iter_from_commodity (model, commodity, &iter)) {
LEAVE("no iter");
return;
@ -1230,7 +1230,7 @@ gnc_tree_model_commodity_event_handler (GUID *entity, QofIdType type,
namespace = gnc_commodity_find_namespace_by_guid(entity, gnc_get_current_book ());
name = gnc_commodity_namespace_get_name(namespace);
if (event_type != GNC_EVENT_DESTROY) {
if (event_type != QOF_EVENT_DESTROY) {
if (!gnc_tree_model_commodity_get_iter_from_namespace (model, namespace, &iter)) {
LEAVE("no iter");
return;
@ -1241,13 +1241,13 @@ gnc_tree_model_commodity_event_handler (GUID *entity, QofIdType type,
}
switch (event_type) {
case GNC_EVENT_ADD:
case QOF_EVENT_ADD:
/* Tell the filters/views where the new account was added. */
DEBUG("add %s", name);
gnc_tree_model_commodity_path_added (model, &iter);
break;
case GNC_EVENT_REMOVE:
case QOF_EVENT_REMOVE:
/* Record the path of this account for later use in destruction */
DEBUG("remove %s", name);
path = gtk_tree_model_get_path (GTK_TREE_MODEL(model), &iter);
@ -1266,7 +1266,7 @@ gnc_tree_model_commodity_event_handler (GUID *entity, QofIdType type,
LEAVE(" ");
return;
case GNC_EVENT_MODIFY:
case QOF_EVENT_MODIFY:
DEBUG("change %s", name);
path = gtk_tree_model_get_path (GTK_TREE_MODEL(model), &iter);
if (path == NULL) {

View File

@ -102,7 +102,7 @@ static gboolean gnc_tree_model_price_iter_parent (GtkTreeModel *tree_model,
GtkTreeIter *iter,
GtkTreeIter *child);
static void gnc_tree_model_price_event_handler (GUID *entity, QofIdType type,
GNCEngineEventType event_type,
QofEventId event_type,
gpointer user_data);
/** The instance private data for a price database tree model. */
@ -1445,7 +1445,7 @@ gnc_tree_model_price_do_deletions (gpointer unused)
*/
static void
gnc_tree_model_price_event_handler (GUID *entity, QofIdType type,
GNCEngineEventType event_type,
QofEventId event_type,
gpointer user_data)
{
GncTreeModelPrice *model;
@ -1467,7 +1467,7 @@ gnc_tree_model_price_event_handler (GUID *entity, QofIdType type,
commodity = gnc_commodity_find_commodity_by_guid(entity, gnc_get_current_book ());
name = gnc_commodity_get_mnemonic(commodity);
if (event_type != GNC_EVENT_DESTROY) {
if (event_type != QOF_EVENT_DESTROY) {
if (!gnc_tree_model_price_get_iter_from_commodity (model, commodity, &iter)) {
LEAVE("no iter");
return;
@ -1478,7 +1478,7 @@ gnc_tree_model_price_event_handler (GUID *entity, QofIdType type,
namespace = gnc_commodity_find_namespace_by_guid(entity, gnc_get_current_book ());
name = gnc_commodity_namespace_get_name(namespace);
if (event_type != GNC_EVENT_DESTROY) {
if (event_type != QOF_EVENT_DESTROY) {
if (!gnc_tree_model_price_get_iter_from_namespace (model, namespace, &iter)) {
LEAVE("no iter");
return;
@ -1489,7 +1489,7 @@ gnc_tree_model_price_event_handler (GUID *entity, QofIdType type,
price = gnc_price_lookup(entity, gnc_get_current_book ());
name = "price";
if (event_type != GNC_EVENT_DESTROY) {
if (event_type != QOF_EVENT_DESTROY) {
if (!gnc_tree_model_price_get_iter_from_price (model, price, &iter)) {
LEAVE("no iter");
return;
@ -1500,13 +1500,13 @@ gnc_tree_model_price_event_handler (GUID *entity, QofIdType type,
}
switch (event_type) {
case GNC_EVENT_ADD:
case QOF_EVENT_ADD:
/* Tell the filters/views where the new account was added. */
DEBUG("add %s", name);
gnc_tree_model_price_path_added (model, &iter);
break;
case GNC_EVENT_REMOVE:
case QOF_EVENT_REMOVE:
/* Record the path of this account for later use in destruction */
DEBUG("remove %s", name);
path = gtk_tree_model_get_path (GTK_TREE_MODEL(model), &iter);
@ -1525,7 +1525,7 @@ gnc_tree_model_price_event_handler (GUID *entity, QofIdType type,
LEAVE(" ");
return;
case GNC_EVENT_MODIFY:
case QOF_EVENT_MODIFY:
DEBUG("change %s", name);
path = gtk_tree_model_get_path (GTK_TREE_MODEL(model), &iter);
if (path == NULL) {

View File

@ -489,7 +489,7 @@ gnc_main_window_summary_new (void)
NULL, retval);
gnc_gui_component_watch_entity_type (retval->component_id,
GNC_ID_ACCOUNT,
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
for ( i = 0; i < N_COLUMNS; i++ )
{

View File

@ -843,7 +843,7 @@ gnc_tax_info_dialog (GtkWidget * parent)
gnc_gui_component_watch_entity_type (component_id,
GNC_ID_ACCOUNT,
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
gtk_widget_grab_focus (ti_dialog->account_treeview);

View File

@ -643,7 +643,7 @@ balance_cell_edited (GtkCellRendererText *cell,
g_object_set (G_OBJECT(cell), "text", "", NULL);
}
set_final_balance (data->balance_hash, account, amount);
gnc_engine_gen_event ((QofEntity*)account, GNC_EVENT_MODIFY);
qof_event_gen ((QofEntity*)account, QOF_EVENT_MODIFY, NULL);
}
static void

View File

@ -746,7 +746,7 @@ gnc_stock_split_dialog (GtkWidget *parent, Account * initial)
gnc_gui_component_watch_entity_type (component_id,
GNC_ID_ACCOUNT,
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
if (fill_account_list (info, initial) == 0)
{

View File

@ -341,11 +341,11 @@ gnc_plugin_page_budget_refresh_cb(GHashTable *changes, gpointer user_data)
if (changes) {
ei = gnc_gui_get_entity_events(changes, &priv->key);
if (ei) {
if (ei->event_mask & GNC_EVENT_DESTROY) {
if (ei->event_mask & QOF_EVENT_DESTROY) {
gnc_plugin_page_budget_close_cb(user_data);
return;
}
if (ei->event_mask & GNC_EVENT_MODIFY) {
if (ei->event_mask & QOF_EVENT_MODIFY) {
DEBUG("refreshing budget view because budget was modified");
gnc_plugin_page_budget_view_refresh(page);
}
@ -425,7 +425,7 @@ gnc_plugin_page_budget_create_widget (GncPluginPage *plugin_page)
gnc_gui_component_watch_entity (priv->component_id,
gnc_budget_get_guid(priv->budget),
GNC_EVENT_DESTROY | GNC_EVENT_MODIFY);
QOF_EVENT_DESTROY | QOF_EVENT_MODIFY);
gnc_plugin_page_budget_view_refresh(page);

View File

@ -746,7 +746,7 @@ gnc_plugin_page_register_create_widget (GncPluginPage *plugin_page)
if (acct)
gnc_gui_component_watch_entity (
priv->component_manager_id, xaccAccountGetGUID(acct),
GNC_EVENT_DESTROY | GNC_EVENT_MODIFY);
QOF_EVENT_DESTROY | QOF_EVENT_MODIFY);
/* DRH - Probably lots of other stuff from regWindowLedger should end up here. */
@ -2716,11 +2716,11 @@ gnc_plugin_page_register_refresh_cb (GHashTable *changes, gpointer user_data)
const EventInfo* ei;
ei = gnc_gui_get_entity_events(changes, &priv->key);
if (ei) {
if (ei->event_mask & GNC_EVENT_DESTROY) {
if (ei->event_mask & QOF_EVENT_DESTROY) {
gnc_main_window_close_page(GNC_PLUGIN_PAGE(page));
return;
}
if (ei->event_mask & GNC_EVENT_MODIFY) {
if (ei->event_mask & QOF_EVENT_MODIFY) {
/* CAS: We need to also handle account renames, but at
least we don't crash for those. */
}

View File

@ -649,7 +649,7 @@ gnc_lot_viewer_dialog (Account *account)
gnc_gui_component_watch_entity_type (component_id,
GNC_ID_LOT,
GNC_EVENT_CREATE | GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_CREATE | QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
gtk_widget_show_all (lv->window);
gnc_window_adjust_for_screen (GTK_WINDOW(lv->window));

View File

@ -1276,7 +1276,7 @@ recn_set_watches_one_account (gpointer data, gpointer user_data)
gnc_gui_component_watch_entity (recnData->component_id,
xaccTransGetGUID (trans),
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
break;
default:
@ -1296,7 +1296,7 @@ recn_set_watches (RecnWindow *recnData)
gnc_gui_component_watch_entity (recnData->component_id,
&recnData->account,
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
account = recn_get_account (recnData);
@ -1329,7 +1329,7 @@ refresh_handler (GHashTable *changes, gpointer user_data)
if (changes)
{
info = gnc_gui_get_entity_events (changes, &recnData->account);
if (info && (info->event_mask & GNC_EVENT_DESTROY))
if (info && (info->event_mask & QOF_EVENT_DESTROY))
{
gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
return;

View File

@ -508,7 +508,7 @@ gnc_ledger_display_set_watches (GNCLedgerDisplay *ld, GList *splits)
gnc_gui_component_watch_entity_type (ld->component_id,
GNC_ID_ACCOUNT,
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
for (node = splits; node; node = node->next)
{
@ -517,7 +517,7 @@ gnc_ledger_display_set_watches (GNCLedgerDisplay *ld, GList *splits)
gnc_gui_component_watch_entity (ld->component_id,
xaccTransGetGUID (trans),
GNC_EVENT_MODIFY);
QOF_EVENT_MODIFY);
}
}
@ -547,7 +547,7 @@ refresh_handler (GHashTable *changes, gpointer user_data)
if (changes && has_leader)
{
info = gnc_gui_get_entity_events (changes, &ld->leader);
if (info && (info->event_mask & GNC_EVENT_DESTROY))
if (info && (info->event_mask & QOF_EVENT_DESTROY))
{
gnc_close_gui_component (ld->component_id);
return;