diff --git a/src/engine/kvp-util.c b/src/engine/kvp-util.c index daf3327ffe..790a909294 100644 --- a/src/engine/kvp-util.c +++ b/src/engine/kvp-util.c @@ -25,7 +25,6 @@ #include #include -#include "gnc-engine-util.h" #include "kvp_frame.h" #include "kvp-util.h" diff --git a/src/engine/qofinstance.c b/src/engine/qofinstance.c index 21bf70869e..9e13cd01cf 100644 --- a/src/engine/qofinstance.c +++ b/src/engine/qofinstance.c @@ -7,7 +7,9 @@ * Copyright (C) 2003 Linas Vepstas */ +#include "kvp-util-p.h" #include "qofbook.h" +#include "qofbook-p.h" #include "qofid.h" #include "qofid-p.h" #include "qofinstance.h" @@ -51,3 +53,22 @@ qof_instance_get_slots (QofInstance *inst) return inst->kvp_data; } +void +qof_instance_gemini (QofInstance *to, QofInstance *from) +{ + time_t now; + now = time(0); + + /* Make a note of where the copy came from */ + gnc_kvp_bag_add (to->kvp_data, "gemini", now, + "inst_guid", &from->guid, + "book_guid", &from->book->guid, + NULL); + gnc_kvp_bag_add (from->kvp_data, "gemini", now, + "inst_guid", &to->guid, + "book_guid", &to->book->guid, + NULL); + + to->dirty = TRUE; +} + diff --git a/src/engine/qofinstance.h b/src/engine/qofinstance.h index 02b2ff6480..3109e7730d 100644 --- a/src/engine/qofinstance.h +++ b/src/engine/qofinstance.h @@ -54,4 +54,10 @@ const GUID * qof_instance_get_guid (QofInstance *); /** return the pointer to the kvp_data */ KvpFrame* qof_instance_get_slots (QofInstance *); +/** pair things up. Currently, this routine only inserts a + * pair of guid-pointers pointing to each other. it + * doesn't copy any data. + */ +void qof_instance_gemini (QofInstance *to, QofInstance *from); + #endif /* QOF_INSTANCE_H */