mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-10-15 02:42:00 -05:00
Use the existing QOF API to modify the instance dirty flag.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13912 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
1 parent
222b2b26d0
commit
2ba716c4ed
16 files changed
+62
-51
No files matched your search
@@ -1,3 +1,23 @@
|
||||
2006-05-02 David Hampton <hampton@employees.org>
|
||||
|
||||
* src/backend/postgres/price.c:
|
||||
* src/business/business-core/gncJob.c:
|
||||
* src/business/business-core/gncInvoice.c:
|
||||
* src/business/business-core/gncVendor.c:
|
||||
* src/business/business-core/gncEntry.c:
|
||||
* src/business/business-core/gncCustomer.c:
|
||||
* src/business/business-core/gncBillTerm.c:
|
||||
* src/business/business-core/gncOrder.c:
|
||||
* src/business/business-core/gncEmployee.c:
|
||||
* src/business/business-core/gncTaxTable.c:
|
||||
* src/engine/gnc-budget.c:
|
||||
* src/engine/Account.c:
|
||||
* src/engine/Group.c:
|
||||
* src/engine/gnc-commodity.c:
|
||||
* src/engine/SchedXaction.c:
|
||||
* lib/libqof/qof/qofobject.c: Use the existing QOF API to modify
|
||||
the instance dirty flag.
|
||||
|
||||
2006-05-02 Andreas Köhler <andi5.py@gmx.net>
|
||||
|
||||
* src/gnome/glade/sched-xact.glade: Correct option strings in sx
|
||||
|
||||
@@ -520,7 +520,8 @@ pgend_price_commit_edit (QofBackend * bend, GNCPrice *pr)
|
||||
SEND_QUERY (be,bufp,);
|
||||
FINISH_QUERY(be->connection);
|
||||
|
||||
if (pr->db) pr->db->inst.dirty = FALSE;
|
||||
if (pr->db)
|
||||
qof_instance_mark_clean(&pr->db->inst);
|
||||
|
||||
LEAVE ("commited");
|
||||
return;
|
||||
|
||||
@@ -84,8 +84,7 @@ FROM_STRING_DEC(GncBillTermType, ENUM_TERMS_TYPE)
|
||||
static inline void
|
||||
mark_term (GncBillTerm *term)
|
||||
{
|
||||
term->inst.dirty = TRUE;
|
||||
qof_collection_mark_dirty (term->inst.entity.collection);
|
||||
qof_instance_set_dirty(&term->inst);
|
||||
qof_event_gen (&term->inst.entity, QOF_EVENT_MODIFY, NULL);
|
||||
}
|
||||
|
||||
@@ -151,7 +150,7 @@ void gncBillTermDestroy (GncBillTerm *term)
|
||||
DEBUG("destroying bill term %s (%p)",
|
||||
guid_to_string(qof_instance_get_guid(&term->inst)), term);
|
||||
term->inst.do_free = TRUE;
|
||||
qof_collection_mark_dirty (term->inst.entity.collection);
|
||||
qof_instance_set_dirty (&term->inst);
|
||||
gncBillTermCommitEdit (term);
|
||||
}
|
||||
|
||||
|
||||
@@ -78,8 +78,7 @@ static QofLogModule log_module = GNC_MOD_BUSINESS;
|
||||
G_INLINE_FUNC void mark_customer (GncCustomer *customer);
|
||||
void mark_customer (GncCustomer *customer)
|
||||
{
|
||||
customer->inst.dirty = TRUE;
|
||||
qof_collection_mark_dirty (customer->inst.entity.collection);
|
||||
qof_instance_set_dirty(&customer->inst);
|
||||
qof_event_gen (&customer->inst.entity, QOF_EVENT_MODIFY, NULL);
|
||||
}
|
||||
|
||||
@@ -160,7 +159,7 @@ void gncCustomerDestroy (GncCustomer *cust)
|
||||
{
|
||||
if (!cust) return;
|
||||
cust->inst.do_free = TRUE;
|
||||
qof_collection_mark_dirty (cust->inst.entity.collection);
|
||||
qof_instance_set_dirty (&cust->inst);
|
||||
gncCustomerCommitEdit (cust);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,8 +61,7 @@ static QofLogModule log_module = GNC_MOD_BUSINESS;
|
||||
G_INLINE_FUNC void mark_employee (GncEmployee *employee);
|
||||
void mark_employee (GncEmployee *employee)
|
||||
{
|
||||
employee->inst.dirty = TRUE;
|
||||
qof_collection_mark_dirty (employee->inst.entity.collection);
|
||||
qof_instance_set_dirty(&employee->inst);
|
||||
qof_event_gen (&employee->inst.entity, QOF_EVENT_MODIFY, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -168,8 +168,7 @@ gboolean gncEntryPaymentStringToType (const char *str, GncEntryPaymentType *type
|
||||
G_INLINE_FUNC void mark_entry (GncEntry *entry);
|
||||
void mark_entry (GncEntry *entry)
|
||||
{
|
||||
entry->inst.dirty = TRUE;
|
||||
qof_collection_mark_dirty (entry->inst.entity.collection);
|
||||
qof_instance_set_dirty(&entry->inst);
|
||||
qof_event_gen (&entry->inst.entity, QOF_EVENT_MODIFY, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -90,8 +90,7 @@ static void mark_invoice (GncInvoice *invoice);
|
||||
static void
|
||||
mark_invoice (GncInvoice *invoice)
|
||||
{
|
||||
invoice->inst.dirty = TRUE;
|
||||
qof_collection_mark_dirty (invoice->inst.entity.collection);
|
||||
qof_instance_set_dirty(&invoice->inst);
|
||||
qof_event_gen (&invoice->inst.entity, QOF_EVENT_MODIFY, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -56,8 +56,7 @@ static QofLogModule log_module = GNC_MOD_BUSINESS;
|
||||
G_INLINE_FUNC void mark_job (GncJob *job);
|
||||
void mark_job (GncJob *job)
|
||||
{
|
||||
job->inst.dirty = TRUE;
|
||||
qof_collection_mark_dirty (job->inst.entity.collection);
|
||||
qof_instance_set_dirty(&job->inst);
|
||||
qof_event_gen (&job->inst.entity, QOF_EVENT_MODIFY, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -70,8 +70,7 @@ static QofLogModule log_module = GNC_MOD_BUSINESS;
|
||||
G_INLINE_FUNC void mark_order (GncOrder *order);
|
||||
void mark_order (GncOrder *order)
|
||||
{
|
||||
order->inst.dirty = TRUE;
|
||||
qof_collection_mark_dirty (order->inst.entity.collection);
|
||||
qof_instance_set_dirty(&order->inst);
|
||||
qof_event_gen (&order->inst.entity, QOF_EVENT_MODIFY, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -143,8 +143,7 @@ gncTaxIncludedStringToType (const char *str, GncTaxIncluded *type)
|
||||
static inline void
|
||||
mark_table (GncTaxTable *table)
|
||||
{
|
||||
table->inst.dirty = TRUE;
|
||||
qof_collection_mark_dirty (table->inst.entity.collection);
|
||||
qof_instance_set_dirty(&table->inst);
|
||||
qof_event_gen (&table->inst.entity, QOF_EVENT_MODIFY, NULL);
|
||||
}
|
||||
|
||||
@@ -289,7 +288,7 @@ gncTaxTableDestroy (GncTaxTable *table)
|
||||
{
|
||||
if (!table) return;
|
||||
table->inst.do_free = TRUE;
|
||||
qof_collection_mark_dirty (table->inst.entity.collection);
|
||||
qof_instance_set_dirty (&table->inst);
|
||||
gncTaxTableCommitEdit (table);
|
||||
}
|
||||
|
||||
|
||||
@@ -67,8 +67,7 @@ static QofLogModule log_module = GNC_MOD_BUSINESS;
|
||||
G_INLINE_FUNC void mark_vendor (GncVendor *vendor);
|
||||
void mark_vendor (GncVendor *vendor)
|
||||
{
|
||||
vendor->inst.dirty = TRUE;
|
||||
qof_collection_mark_dirty (vendor->inst.entity.collection);
|
||||
qof_instance_set_dirty(&vendor->inst);
|
||||
qof_event_gen (&vendor->inst.entity, QOF_EVENT_MODIFY, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ void
|
||||
mark_account (Account *acc)
|
||||
{
|
||||
if (acc->parent) acc->parent->saved = FALSE;
|
||||
acc->inst.dirty = TRUE;
|
||||
qof_instance_set_dirty(&acc->inst);
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
@@ -215,7 +215,7 @@ Account *
|
||||
xaccCloneAccountSimple (const Account *from, QofBook *book)
|
||||
{
|
||||
Account *ret = xaccCloneAccountCommon(from, book);
|
||||
ret->inst.dirty = TRUE;
|
||||
qof_instance_set_dirty(&ret->inst);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -393,7 +393,7 @@ xaccAccountCommitEdit (Account *acc)
|
||||
g_list_free (acc->lots);
|
||||
acc->lots = NULL;
|
||||
|
||||
acc->inst.dirty = TRUE;
|
||||
qof_instance_set_dirty(&acc->inst);
|
||||
acc->inst.editlevel--;
|
||||
}
|
||||
else
|
||||
@@ -675,7 +675,7 @@ xaccAccountSetGUID (Account *acc, const GUID *guid)
|
||||
PINFO("acct=%p", acc);
|
||||
xaccAccountBeginEdit (acc);
|
||||
qof_entity_set_guid (&acc->inst.entity, guid);
|
||||
acc->inst.dirty = TRUE;
|
||||
qof_instance_set_dirty(&acc->inst);
|
||||
xaccAccountCommitEdit (acc);
|
||||
}
|
||||
|
||||
@@ -1245,7 +1245,7 @@ DxaccAccountSetCurrency (Account * acc, gnc_commodity * currency)
|
||||
kvp_frame_set_slot_nc(acc->inst.kvp_data, "old-currency",
|
||||
kvp_value_new_string(string));
|
||||
mark_account (acc);
|
||||
acc->inst.dirty = TRUE;
|
||||
qof_instance_set_dirty(&acc->inst);
|
||||
xaccAccountCommitEdit(acc);
|
||||
|
||||
commodity = DxaccAccountGetCurrency (acc);
|
||||
@@ -2488,7 +2488,7 @@ dxaccAccountSetPriceSrc(Account *acc, const char *src)
|
||||
mark_account (acc);
|
||||
}
|
||||
|
||||
acc->inst.dirty = TRUE;
|
||||
qof_instance_set_dirty(&acc->inst);
|
||||
xaccAccountCommitEdit(acc);
|
||||
}
|
||||
|
||||
@@ -2523,7 +2523,7 @@ dxaccAccountSetQuoteTZ(Account *acc, const char *tz)
|
||||
tz ? kvp_value_new_string(tz) : NULL);
|
||||
mark_account (acc);
|
||||
}
|
||||
acc->inst.dirty = TRUE;
|
||||
qof_instance_set_dirty(&acc->inst);
|
||||
xaccAccountCommitEdit(acc);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -797,7 +797,7 @@ xaccGroupInsertAccount (AccountGroup *grp, Account *acc)
|
||||
/* Gather event data */
|
||||
qof_event_gen (&acc->inst.entity, QOF_EVENT_ADD, NULL);
|
||||
|
||||
acc->inst.dirty = TRUE;
|
||||
qof_instance_set_dirty(&acc->inst);
|
||||
xaccAccountCommitEdit (acc);
|
||||
}
|
||||
|
||||
@@ -861,7 +861,7 @@ xaccGroupCopyGroup (AccountGroup *to, AccountGroup *from)
|
||||
to->accounts = g_list_append (to->accounts, to_acc);
|
||||
|
||||
to_acc->parent = to;
|
||||
to_acc->inst.dirty = TRUE;
|
||||
qof_instance_set_dirty(&to_acc->inst);
|
||||
|
||||
/* Copy child accounts too. */
|
||||
if (from_acc->children)
|
||||
|
||||
+12
-12
@@ -194,7 +194,7 @@ xaccSchedXactionSetFreqSpec( SchedXaction *sx, FreqSpec *fs )
|
||||
|
||||
xaccFreqSpecFree( sx->freq );
|
||||
sx->freq = fs;
|
||||
sx->inst.dirty = TRUE;
|
||||
qof_instance_set_dirty(&sx->inst);
|
||||
}
|
||||
|
||||
gchar *
|
||||
@@ -211,8 +211,8 @@ xaccSchedXactionSetName( SchedXaction *sx, const gchar *newName )
|
||||
g_free( sx->name );
|
||||
sx->name = NULL;
|
||||
}
|
||||
sx->inst.dirty = TRUE;
|
||||
sx->name = g_strdup( newName );
|
||||
qof_instance_set_dirty(&sx->inst);
|
||||
}
|
||||
|
||||
GDate*
|
||||
@@ -225,7 +225,7 @@ void
|
||||
xaccSchedXactionSetStartDate( SchedXaction *sx, GDate* newStart )
|
||||
{
|
||||
sx->start_date = *newStart;
|
||||
sx->inst.dirty = TRUE;
|
||||
qof_instance_set_dirty(&sx->inst);
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -255,7 +255,7 @@ xaccSchedXactionSetEndDate( SchedXaction *sx, GDate *newEnd )
|
||||
}
|
||||
|
||||
sx->end_date = *newEnd;
|
||||
sx->inst.dirty = TRUE;
|
||||
qof_instance_set_dirty(&sx->inst);
|
||||
}
|
||||
|
||||
GDate*
|
||||
@@ -268,7 +268,7 @@ void
|
||||
xaccSchedXactionSetLastOccurDate( SchedXaction *sx, GDate* newLastOccur )
|
||||
{
|
||||
sx->last_date = *newLastOccur;
|
||||
sx->inst.dirty = TRUE;
|
||||
qof_instance_set_dirty(&sx->inst);
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -287,7 +287,7 @@ void
|
||||
xaccSchedXactionSetNumOccur( SchedXaction *sx, gint newNum )
|
||||
{
|
||||
sx->num_occurances_remain = sx->num_occurances_total = newNum;
|
||||
sx->inst.dirty = TRUE;
|
||||
qof_instance_set_dirty(&sx->inst);
|
||||
}
|
||||
|
||||
gint
|
||||
@@ -308,7 +308,7 @@ xaccSchedXactionSetRemOccur( SchedXaction *sx,
|
||||
else
|
||||
{
|
||||
sx->num_occurances_remain = numRemain;
|
||||
sx->inst.dirty = TRUE;
|
||||
qof_instance_set_dirty(&sx->inst);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ xaccSchedXactionSetSlot( SchedXaction *sx,
|
||||
if (!sx) return;
|
||||
|
||||
kvp_frame_set_slot( sx->inst.kvp_data, slot, value );
|
||||
sx->inst.dirty = TRUE;
|
||||
qof_instance_set_dirty(&sx->inst);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -350,7 +350,7 @@ xaccSchedXactionSetAutoCreate( SchedXaction *sx,
|
||||
|
||||
sx->autoCreateOption = newAutoCreate;
|
||||
sx->autoCreateNotify = newNotify;
|
||||
sx->inst.dirty = TRUE;
|
||||
qof_instance_set_dirty(&sx->inst);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -364,7 +364,7 @@ void
|
||||
xaccSchedXactionSetAdvanceCreation( SchedXaction *sx, gint createDays )
|
||||
{
|
||||
sx->advanceCreateDays = createDays;
|
||||
sx->inst.dirty = TRUE;
|
||||
qof_instance_set_dirty(&sx->inst);
|
||||
}
|
||||
|
||||
gint
|
||||
@@ -376,8 +376,8 @@ xaccSchedXactionGetAdvanceReminder( SchedXaction *sx )
|
||||
void
|
||||
xaccSchedXactionSetAdvanceReminder( SchedXaction *sx, gint reminderDays )
|
||||
{
|
||||
sx->inst.dirty = TRUE;
|
||||
sx->advanceRemindDays = reminderDays;
|
||||
qof_instance_set_dirty(&sx->inst);
|
||||
}
|
||||
|
||||
|
||||
@@ -660,7 +660,7 @@ gnc_sx_revert_to_temporal_state( SchedXaction *sx, void *stateData )
|
||||
sx->last_date = tsd->last_date;
|
||||
sx->num_occurances_remain = tsd->num_occur_rem;
|
||||
sx->instance_num = tsd->num_inst;
|
||||
sx->inst.dirty = TRUE;
|
||||
qof_instance_set_dirty(&sx->inst);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -79,7 +79,7 @@ gnc_budget_free(GncBudget* budget)
|
||||
|
||||
g_return_if_fail(GNC_IS_BUDGET(budget));
|
||||
|
||||
qof_collection_mark_dirty(budget->inst.entity.collection);
|
||||
qof_instance_set_dirty(&budget->inst);
|
||||
/* 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. */
|
||||
@@ -98,7 +98,7 @@ gnc_budget_set_name(GncBudget* budget, const gchar* name)
|
||||
g_return_if_fail(GNC_IS_BUDGET(budget) && name);
|
||||
|
||||
CACHE_REPLACE(budget->name, name);
|
||||
qof_collection_mark_dirty(budget->inst.entity.collection);
|
||||
qof_instance_set_dirty(&budget->inst);
|
||||
|
||||
qof_event_gen( &budget->inst.entity, QOF_EVENT_MODIFY, NULL);
|
||||
}
|
||||
@@ -117,7 +117,7 @@ gnc_budget_set_description(GncBudget* budget, const gchar* description)
|
||||
g_return_if_fail(description);
|
||||
|
||||
CACHE_REPLACE(budget->description, description);
|
||||
qof_collection_mark_dirty(budget->inst.entity.collection);
|
||||
qof_instance_set_dirty(&budget->inst);
|
||||
|
||||
qof_event_gen( &budget->inst.entity, QOF_EVENT_MODIFY, NULL);
|
||||
}
|
||||
@@ -134,7 +134,7 @@ gnc_budget_set_recurrence(GncBudget *budget, const Recurrence *r)
|
||||
{
|
||||
g_return_if_fail(budget && r);
|
||||
budget->recurrence = *r;
|
||||
qof_collection_mark_dirty(budget->inst.entity.collection);
|
||||
qof_instance_set_dirty(&budget->inst);
|
||||
|
||||
qof_event_gen(&budget->inst.entity, QOF_EVENT_MODIFY, NULL);
|
||||
}
|
||||
@@ -159,7 +159,7 @@ gnc_budget_set_num_periods(GncBudget* budget, guint num_periods)
|
||||
{
|
||||
g_return_if_fail(GNC_IS_BUDGET(budget));
|
||||
budget->num_periods = num_periods;
|
||||
qof_collection_mark_dirty(budget->inst.entity.collection);
|
||||
qof_instance_set_dirty(&budget->inst);
|
||||
|
||||
qof_event_gen( &budget->inst.entity, QOF_EVENT_MODIFY, NULL);
|
||||
}
|
||||
@@ -191,7 +191,7 @@ gnc_budget_set_account_period_value(GncBudget *budget, Account *account,
|
||||
g_sprintf(bufend, "/%d", period_num);
|
||||
|
||||
kvp_frame_set_numeric(frame, path, val);
|
||||
qof_collection_mark_dirty(budget->inst.entity.collection);
|
||||
qof_instance_set_dirty(&budget->inst);
|
||||
|
||||
qof_event_gen( &budget->inst.entity, QOF_EVENT_MODIFY, NULL);
|
||||
|
||||
|
||||
@@ -474,8 +474,7 @@ gnc_quote_source_set_fq_installed (GList *sources_list)
|
||||
static void
|
||||
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);
|
||||
qof_instance_set_dirty(&cm->inst);
|
||||
qof_event_gen (&cm->inst.entity, QOF_EVENT_MODIFY, NULL);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user