mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Wrap g_object_get/set with qof_instance_get/set
qof_instance_set marks dirty and will eventually also begin and commit edits.
This commit is contained in:
parent
1f3fbf4b52
commit
d5a9cda70e
@ -946,6 +946,31 @@ gboolean qof_instance_refers_to_object(const QofInstance* inst, const QofInstanc
|
||||
}
|
||||
}
|
||||
|
||||
/* g_object_set/get wrappers */
|
||||
void
|
||||
qof_instance_get (const QofInstance *inst, const gchar *first_prop, ...)
|
||||
{
|
||||
va_list ap;
|
||||
g_return_if_fail (QOF_IS_INSTANCE (inst));
|
||||
|
||||
va_start (ap, first_prop);
|
||||
g_object_get_valist (G_OBJECT (inst), first_prop, ap);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
void
|
||||
qof_instance_set (QofInstance *inst, const gchar *first_prop, ...)
|
||||
{
|
||||
va_list ap;
|
||||
g_return_if_fail (QOF_IS_INSTANCE (inst));
|
||||
|
||||
qof_instance_set_dirty (inst);
|
||||
va_start (ap, first_prop);
|
||||
g_object_set_valist (G_OBJECT (inst), first_prop, ap);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
|
||||
/* =================================================================== */
|
||||
/* Entity edit and commit utilities */
|
||||
/* =================================================================== */
|
||||
|
@ -167,7 +167,16 @@ gboolean qof_instance_get_dirty (QofInstance *);
|
||||
|
||||
gboolean qof_instance_get_infant(const QofInstance *inst);
|
||||
|
||||
/**
|
||||
* \brief Wrapper for g_object_get
|
||||
*/
|
||||
void qof_instance_get (const QofInstance *inst, const gchar *first_param, ...);
|
||||
|
||||
/**
|
||||
* \brief Wrapper for g_object_set
|
||||
* Group setting multiple parameters in a single begin/commit/rollback
|
||||
*/
|
||||
void qof_instance_set (QofInstance *inst, const gchar *first_param, ...);
|
||||
|
||||
/** get the instance tag number
|
||||
used for kvp management in sql backends. */
|
||||
|
Loading…
Reference in New Issue
Block a user