mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
make the gemini code generic
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9470 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
d532657989
commit
f2f56a1a27
@ -25,7 +25,6 @@
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdio.h>
|
||||
#include "gnc-engine-util.h"
|
||||
|
||||
#include "kvp_frame.h"
|
||||
#include "kvp-util.h"
|
||||
|
@ -7,7 +7,9 @@
|
||||
* Copyright (C) 2003 Linas Vepstas <linas@linas.org>
|
||||
*/
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user