mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Provide qof_instance with functions to delete slots.
This commit is contained in:
parent
eb2d556086
commit
232dd4c0dc
@ -126,6 +126,9 @@ gboolean qof_instance_kvp_has_guid (const QofInstance *inst, const char *path,
|
|||||||
void qof_instance_kvp_merge_guids (const QofInstance *target,
|
void qof_instance_kvp_merge_guids (const QofInstance *target,
|
||||||
const QofInstance *donor, const char* path);
|
const QofInstance *donor, const char* path);
|
||||||
gboolean qof_instance_has_slot (const QofInstance *inst, const char *path);
|
gboolean qof_instance_has_slot (const QofInstance *inst, const char *path);
|
||||||
|
void qof_instance_slot_delete (const QofInstance *inst, const char *path);
|
||||||
|
void qof_instance_slot_delete_if_empty (const QofInstance *inst,
|
||||||
|
const char *path);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -1273,5 +1273,19 @@ qof_instance_has_slot (const QofInstance *inst, const char *path)
|
|||||||
return kvp_frame_get_value (inst->kvp_data, path) != NULL;
|
return kvp_frame_get_value (inst->kvp_data, path) != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
qof_instance_slot_delete (const QofInstance *inst, const char *path)
|
||||||
|
{
|
||||||
|
kvp_frame_set_frame_nc (inst->kvp_data, path, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
qof_instance_slot_delete_if_empty (const QofInstance *inst, const char *path)
|
||||||
|
{
|
||||||
|
KvpFrame *frame = kvp_frame_get_frame (inst->kvp_data, path);
|
||||||
|
if (frame && kvp_frame_is_empty (frame))
|
||||||
|
kvp_frame_set_frame_nc (inst->kvp_data, path, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
/* ========================== END OF FILE ======================= */
|
/* ========================== END OF FILE ======================= */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user