r16212 - gnucash/trunk - Revert some qof_instance_get_guid() calls to qof_entity_get_guid().

Andreas Köhler andi5 at cvs.gnucash.org
Mon Jun 25 13:18:44 EDT 2007


Author: andi5
Date: 2007-06-25 13:18:28 -0400 (Mon, 25 Jun 2007)
New Revision: 16212
Trac: http://svn.gnucash.org/trac/changeset/16212

Modified:
   gnucash/trunk/lib/libqof/backend/file/qsf-backend.c
   gnucash/trunk/lib/libqof/qof/qofbook.c
   gnucash/trunk/lib/libqof/qof/qofbook.h
   gnucash/trunk/lib/libqof/qof/qofbookmerge.c
   gnucash/trunk/lib/libqof/qof/qofinstance.c
   gnucash/trunk/lib/libqof/qof/qofinstance.h
   gnucash/trunk/lib/libqof/qof/qofquery.c
   gnucash/trunk/lib/libqof/qof/qofquerycore.c
   gnucash/trunk/lib/libqof/qof/qofreference.c
   gnucash/trunk/lib/libqof/qof/qofsession.c
   gnucash/trunk/src/app-utils/gnc-component-manager.c
   gnucash/trunk/src/backend/postgres/book.c
   gnucash/trunk/src/backend/postgres/putil.h
   gnucash/trunk/src/backend/postgres/table.m4
   gnucash/trunk/src/business/business-core/gncEmployee.h
   gnucash/trunk/src/engine/Account.h
   gnucash/trunk/src/engine/SchedXaction.h
   gnucash/trunk/src/engine/Split.c
   gnucash/trunk/src/engine/Split.h
   gnucash/trunk/src/engine/Transaction.c
   gnucash/trunk/src/engine/Transaction.h
   gnucash/trunk/src/engine/gnc-budget.h
   gnucash/trunk/src/engine/gnc-lot.c
   gnucash/trunk/src/engine/gnc-lot.h
   gnucash/trunk/src/engine/gnc-pricedb.h
   gnucash/trunk/src/gnome/dialog-chart-export.c
   gnucash/trunk/src/gnome/top-level.c
Log:
Revert some qof_instance_get_guid() calls to qof_entity_get_guid().

Those two functions were merged into one, qof_instance_get_guid(), in
r15773, but they returned different values if the parameter was NULL.
Some code depends on the return value being guid_null(), or maybe even
NULL, so revert the changes entity->instance, where the entity is not
guaranteed to be non-NULL.


Modified: gnucash/trunk/lib/libqof/backend/file/qsf-backend.c
===================================================================
--- gnucash/trunk/lib/libqof/backend/file/qsf-backend.c	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/lib/libqof/backend/file/qsf-backend.c	2007-06-25 17:18:28 UTC (rev 16212)
@@ -709,6 +709,7 @@
 	ref_param = (QofParam*)data;
 	object_node = params->output_node;
 	ent = params->qsf_ent;
+	g_return_if_fail(ent);
 	ns = params->qsf_ns;
 	starter = g_new(QofInstanceReference, 1);
 	starter->ent_guid = qof_instance_get_guid(ent);
@@ -766,6 +767,7 @@
 	const GUID *cm_guid;
 	gchar       cm_sa[GUID_ENCODING_LENGTH + 1];
 
+	g_return_if_fail(ent != NULL);
 	g_return_if_fail(data != NULL);
 	params = (qsf_param*)data;
 	param_count = ++params->count;

Modified: gnucash/trunk/lib/libqof/qof/qofbook.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofbook.c	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/lib/libqof/qof/qofbook.c	2007-06-25 17:18:28 UTC (rev 16212)
@@ -418,7 +418,7 @@
 gboolean qof_book_register (void)
 {
   static QofParam params[] = {
-    { QOF_PARAM_GUID, QOF_TYPE_GUID, (QofAccessFunc)qof_instance_get_guid, NULL },
+    { QOF_PARAM_GUID, QOF_TYPE_GUID, (QofAccessFunc)qof_entity_get_guid, NULL },
     { QOF_PARAM_KVP,  QOF_TYPE_KVP,  (QofAccessFunc)qof_instance_get_slots, NULL },
     { NULL },
   };

Modified: gnucash/trunk/lib/libqof/qof/qofbook.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofbook.h	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/lib/libqof/qof/qofbook.h	2007-06-25 17:18:28 UTC (rev 16212)
@@ -267,7 +267,7 @@
 gint64 qof_book_get_counter (QofBook *book, const char *counter_name);
 
 /** deprecated */
-#define qof_book_get_guid(X) qof_instance_get_guid (QOF_INSTANCE(X))
+#define qof_book_get_guid(X) qof_entity_get_guid (QOF_INSTANCE(X))
 
 #endif /* QOF_BOOK_H */
 /** @} */

Modified: gnucash/trunk/lib/libqof/qof/qofbookmerge.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofbookmerge.c	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/lib/libqof/qof/qofbookmerge.c	2007-06-25 17:18:28 UTC (rev 16212)
@@ -702,6 +702,7 @@
 	g_return_if_fail(rule != NULL);
 	g_return_if_fail(mergeData != NULL);
 	g_return_if_fail(mergeData->targetBook != NULL);
+	g_return_if_fail(rule->importEnt && rule->targetEnt);
 	g_return_if_fail((rule->mergeResult != MERGE_NEW)||(rule->mergeResult != MERGE_UPDATE));
 
 	DEBUG ("qof_book_merge_commit_rule_loop rule: type: %s, result: %s, importEnt Type: %s, guid: %s",

Modified: gnucash/trunk/lib/libqof/qof/qofinstance.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofinstance.c	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/lib/libqof/qof/qofinstance.c	2007-06-25 17:18:28 UTC (rev 16212)
@@ -465,6 +465,12 @@
     return &(priv->guid);
 }
 
+const GUID *
+qof_entity_get_guid (gconstpointer ent)
+{
+    return ent ? qof_instance_get_guid(ent) : guid_null();
+}
+
 void
 qof_instance_set_guid (gpointer ptr, const GUID *guid)
 {

Modified: gnucash/trunk/lib/libqof/qof/qofinstance.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofinstance.h	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/lib/libqof/qof/qofinstance.h	2007-06-25 17:18:28 UTC (rev 16212)
@@ -101,6 +101,10 @@
 /** Return the GUID of this instance */
 const GUID * qof_instance_get_guid (gconstpointer);
 
+/** \deprecated Use qof_instance_get_guid instead.
+ *  Works like qof_instance_get_guid, but returns NULL on NULL */
+const GUID * qof_entity_get_guid (gconstpointer);
+
 /** Return the collection this instance belongs to */
 QofCollection* qof_instance_get_collection (gconstpointer inst);
 

Modified: gnucash/trunk/lib/libqof/qof/qofquery.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofquery.c	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/lib/libqof/qof/qofquery.c	2007-06-25 17:18:28 UTC (rev 16212)
@@ -1275,7 +1275,7 @@
   slist = g_slist_prepend (slist, QOF_PARAM_GUID);
   slist = g_slist_prepend (slist, QOF_PARAM_BOOK);
   qof_query_add_guid_match (q, slist,
-                        qof_book_get_guid(book), QOF_QUERY_AND);
+                            qof_instance_get_guid(book), QOF_QUERY_AND);
 }
 
 GList * qof_query_get_books (QofQuery *q)

Modified: gnucash/trunk/lib/libqof/qof/qofquerycore.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofquerycore.c	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/lib/libqof/qof/qofquerycore.c	2007-06-25 17:18:28 UTC (rev 16212)
@@ -1455,8 +1455,7 @@
 	query_coll_t pdata;
 	GUID *guid;
 
-	guid = guid_malloc();
-	guid = (GUID*)qof_instance_get_guid(ent);
+	guid = (GUID*)qof_entity_get_guid(ent);
 	pdata = (query_coll_t)user_data;
 	pdata->guids = g_list_append(pdata->guids, guid);
 }

Modified: gnucash/trunk/lib/libqof/qof/qofreference.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofreference.c	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/lib/libqof/qof/qofreference.c	2007-06-25 17:18:28 UTC (rev 16212)
@@ -39,7 +39,7 @@
 	QofBook *partial_book;
 	
 	partial_book = (QofBook*)user_data;
-	g_return_if_fail(partial_book || ent);
+	g_return_if_fail(partial_book && ent);
 	reference = NULL;
 	coll = NULL;
 	book_ref_list = qof_book_get_data(partial_book, ENTITYREFERENCE);
@@ -122,6 +122,7 @@
 	char                cm_sa[GUID_ENCODING_LENGTH + 1];
 	gchar              *cm_string;
 
+	g_return_val_if_fail(ent, NULL);
 	ref_ent = QOF_INSTANCE(param->param_getfcn(ent, param));
 	if(!ref_ent) { return NULL; }
 	reference = g_new0(QofInstanceReference, 1);

Modified: gnucash/trunk/lib/libqof/qof/qofsession.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofsession.c	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/lib/libqof/qof/qofsession.c	2007-06-25 17:18:28 UTC (rev 16212)
@@ -368,15 +368,17 @@
 	char         cm_sa[GUID_ENCODING_LENGTH + 1];
 	gchar        *cm_string;
 
+    g_return_if_fail(user_data);
 	qecd = (QofInstanceCopyData*)user_data;
 	ent = qecd->from;
+    g_return_if_fail(ent);
 	ref = g_new0(QofInstanceReference, 1);
 	ref->type = ent->e_type;
 	ref->ref_guid = g_new(GUID, 1);
 	ref->ent_guid = qof_instance_get_guid(ent);
 	ref->param = qof_class_get_parameter(ent->e_type, 
 		qecd->param->param_name);
-	cm_guid = qof_instance_get_guid(ref_ent);
+	cm_guid = qof_entity_get_guid(ref_ent);
 	guid_to_string_buff(cm_guid, cm_sa);
 	cm_string = g_strdup(cm_sa);
 	if(TRUE == string_to_guid(cm_string, ref->ref_guid)) {
@@ -594,7 +596,8 @@
 	QofBook *targetBook;
 	QofCollection *coll;
 	QofInstance *copy;
-	
+
+	g_return_if_fail(original != NULL);
 	g_return_if_fail(user_data != NULL);
 	copy = NULL;
 	qecd = (QofInstanceCopyData*)user_data;
@@ -612,7 +615,8 @@
 	QofBook *book;
 	QofInstance *inst;
 	const GUID *g;
-	
+
+	g_return_if_fail(original != NULL);
 	g_return_if_fail(user_data != NULL);
 	qecd = (QofInstanceCopyData*)user_data;
 	book = qof_session_get_book(qecd->new_session);

Modified: gnucash/trunk/src/app-utils/gnc-component-manager.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-component-manager.c	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/src/app-utils/gnc-component-manager.c	2007-06-25 17:18:28 UTC (rev 16212)
@@ -258,7 +258,7 @@
                       gpointer user_data,
 		      gpointer event_data)
 {
-  const GUID *guid = qof_instance_get_guid(entity);
+  const GUID *guid = qof_entity_get_guid(entity);
 #if CM_DEBUG
   fprintf (stderr, "event_handler: event %d, entity %p, guid %s\n", event_type,
 	   entity, guid);

Modified: gnucash/trunk/src/backend/postgres/book.c
===================================================================
--- gnucash/trunk/src/backend/postgres/book.c	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/src/backend/postgres/book.c	2007-06-25 17:18:28 UTC (rev 16212)
@@ -208,7 +208,7 @@
    for (node=blist; node; node=node->next)
    {
       book = node->data;
-      if (guid_equal (qof_instance_get_guid(QOF_INSTANCE(book)), &guid)) break;
+      if (guid_equal (qof_entity_get_guid(QOF_INSTANCE(book)), &guid)) break;
       book = NULL;
    }
    

Modified: gnucash/trunk/src/backend/postgres/putil.h
===================================================================
--- gnucash/trunk/src/backend/postgres/putil.h	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/src/backend/postgres/putil.h	2007-06-25 17:18:28 UTC (rev 16212)
@@ -358,7 +358,7 @@
       for (node=be->blist; node; node=node->next)                \
       {                                                          \
          book = node->data;                                      \
-         if (guid_equal (qof_instance_get_guid((QofInstance*)book), &book_guid)) break; \
+         if (guid_equal (qof_entity_get_guid((QofInstance*)book), &book_guid)) break; \
          book = NULL;                                            \
       }                                                          \
       if (!book) return data;                                    \

Modified: gnucash/trunk/src/backend/postgres/table.m4
===================================================================
--- gnucash/trunk/src/backend/postgres/table.m4	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/src/backend/postgres/table.m4	2007-06-25 17:18:28 UTC (rev 16212)
@@ -13,7 +13,7 @@
        commodity,      , char *, gnc_commodity_get_unique_name(xaccAccountGetCommodity(ptr)),
        version,        , int32,  qof_instance_get_version(ptr),
        iguid,          , int32,  qof_instance_get_idata(ptr),
-       bookGUID,       , GUID *, qof_instance_get_guid((QofInstance*)gnc_account_get_book(ptr)),
+       bookGUID,       , GUID *, qof_entity_get_guid((QofInstance*)gnc_account_get_book(ptr)),
        parentGUID,     , GUID *, xaccAccountGetGUID(gnc_account_get_parent(ptr)),
        accountGUID, KEY, GUID *, xaccAccountGetGUID(ptr),
        ')
@@ -362,7 +362,7 @@
 
    p = be->buff; *p = 0;
    p = stpcpy (p, "SELECT version FROM tablename($@) WHERE key_fieldname($@) = ''`");
-   p = guid_to_string_buff (qof_instance_get_guid(QOF_INSTANCE(ptr)), p);
+   p = guid_to_string_buff (qof_entity_get_guid(QOF_INSTANCE(ptr)), p);
    p = stpcpy (p, "''`;");
    SEND_QUERY (be,be->buff, -1);
    sql_version = GPOINTER_TO_INT(pgendGetResults (be, get_version_cb, (gpointer) -1));
@@ -392,7 +392,7 @@
 
    p = be->buff; *p = 0;
    p = stpcpy (p, "SELECT version FROM tablename($@)" "Trail WHERE key_fieldname($@) = ''`");
-   p = guid_to_string_buff (qof_instance_get_guid(QOF_INSTANCE(ptr)), p);
+   p = guid_to_string_buff (qof_entity_get_guid(QOF_INSTANCE(ptr)), p);
    p = stpcpy (p, "''` AND change = ''`d''`;");
    SEND_QUERY (be,be->buff, -1);
    sql_version = GPOINTER_TO_INT(pgendGetResults (be, get_version_cb, (gpointer) -1));

Modified: gnucash/trunk/src/business/business-core/gncEmployee.h
===================================================================
--- gnucash/trunk/src/business/business-core/gncEmployee.h	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/src/business/business-core/gncEmployee.h	2007-06-25 17:18:28 UTC (rev 16212)
@@ -114,9 +114,9 @@
 #define EMPLOYEE_CC    "credit_card_account"
 
 /** deprecated routines */
-#define gncEmployeeGetGUID(E) qof_instance_get_guid(QOF_INSTANCE(E))
+#define gncEmployeeGetGUID(E) qof_entity_get_guid(QOF_INSTANCE(E))
 #define gncEmployeeGetBook(E) qof_instance_get_book(QOF_INSTANCE(E))
-#define gncEmployeeRetGUID(E) (E ? *(qof_instance_get_guid(QOF_INSTANCE(E))) : *(guid_null()))
+#define gncEmployeeRetGUID(E) (E ? *(qof_entity_get_guid(QOF_INSTANCE(E))) : *(guid_null()))
 #define gncEmployeeLookupDirect(G,B) gncEmployeeLookup((B),&(G))
 
 #endif /* GNC_EMPLOYEE_H_ */

Modified: gnucash/trunk/src/engine/Account.h
===================================================================
--- gnucash/trunk/src/engine/Account.h	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/src/engine/Account.h	2007-06-25 17:18:28 UTC (rev 16212)
@@ -232,8 +232,8 @@
 void gnc_book_set_root_account(QofBook *book, Account *root);
 
 /** @deprecated */
-#define xaccAccountGetGUID(X)     qof_instance_get_guid(QOF_INSTANCE(X))
-#define xaccAccountReturnGUID(X) (X ? *(qof_instance_get_guid(QOF_INSTANCE(X))) : *(guid_null()))
+#define xaccAccountGetGUID(X)     qof_entity_get_guid(QOF_INSTANCE(X))
+#define xaccAccountReturnGUID(X) (X ? *(qof_entity_get_guid(QOF_INSTANCE(X))) : *(guid_null()))
 
 /** The xaccAccountLookup() subroutine will return the
  *    account associated with the given id, or NULL

Modified: gnucash/trunk/src/engine/SchedXaction.h
===================================================================
--- gnucash/trunk/src/engine/SchedXaction.h	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/src/engine/SchedXaction.h	2007-06-25 17:18:28 UTC (rev 16212)
@@ -318,7 +318,7 @@
 /** \deprecated */
 #define xaccSchedXactionIsDirty(X) qof_instance_is_dirty (QOF_INSTANCE(X))
 /** \deprecated */
-#define xaccSchedXactionGetGUID(X) qof_instance_get_guid(QOF_INSTANCE(X))
+#define xaccSchedXactionGetGUID(X) qof_entity_get_guid(QOF_INSTANCE(X))
 /** \deprecated */
 #define xaccSchedXactionGetSlots(X) qof_instance_get_slots(QOF_INSTANCE(X))
 

Modified: gnucash/trunk/src/engine/Split.c
===================================================================
--- gnucash/trunk/src/engine/Split.c	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/src/engine/Split.c	2007-06-25 17:18:28 UTC (rev 16212)
@@ -1814,7 +1814,7 @@
     { "d-share-amount", QOF_TYPE_DOUBLE,  
       (QofAccessFunc)DxaccSplitGetShareAmount, NULL },
     { "d-share-int64", QOF_TYPE_INT64, 
-      (QofAccessFunc)qof_instance_get_guid, NULL },
+      (QofAccessFunc)qof_entity_get_guid, NULL },
     { SPLIT_BALANCE, QOF_TYPE_NUMERIC, 
       (QofAccessFunc)xaccSplitGetBalance, NULL },
     { SPLIT_CLEARED_BALANCE, QOF_TYPE_NUMERIC,
@@ -1855,7 +1855,7 @@
     { SPLIT_KVP, QOF_TYPE_KVP, (QofAccessFunc)xaccSplitGetSlots, NULL },
     { QOF_PARAM_BOOK, QOF_ID_BOOK, (QofAccessFunc)xaccSplitGetBook, NULL },
     { QOF_PARAM_GUID, QOF_TYPE_GUID, 
-      (QofAccessFunc)qof_instance_get_guid, NULL },
+      (QofAccessFunc)qof_entity_get_guid, NULL },
     { NULL },
   };
 

Modified: gnucash/trunk/src/engine/Split.h
===================================================================
--- gnucash/trunk/src/engine/Split.h	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/src/engine/Split.h	2007-06-25 17:18:28 UTC (rev 16212)
@@ -500,9 +500,9 @@
 /** @} */
 
 /** \deprecated */
-#define xaccSplitGetGUID(X)      qof_instance_get_guid(QOF_INSTANCE(X))
+#define xaccSplitGetGUID(X)      qof_entity_get_guid(QOF_INSTANCE(X))
 /** \deprecated */
-#define xaccSplitReturnGUID(X) (X ? *(qof_instance_get_guid(QOF_INSTANCE(X))) : *(guid_null()))
+#define xaccSplitReturnGUID(X) (X ? *(qof_entity_get_guid(QOF_INSTANCE(X))) : *(guid_null()))
 
 #endif /* XACC_SPLIT_H */
 /** @} */

Modified: gnucash/trunk/src/engine/Transaction.c
===================================================================
--- gnucash/trunk/src/engine/Transaction.c	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/src/engine/Transaction.c	2007-06-25 17:18:28 UTC (rev 16212)
@@ -1971,7 +1971,7 @@
     { QOF_PARAM_BOOK, QOF_ID_BOOK,      
       (QofAccessFunc)qof_instance_get_book, NULL },
     { QOF_PARAM_GUID, QOF_TYPE_GUID,    
-      (QofAccessFunc)qof_instance_get_guid, NULL },
+      (QofAccessFunc)qof_entity_get_guid, NULL },
     { NULL },
   };
 

Modified: gnucash/trunk/src/engine/Transaction.h
===================================================================
--- gnucash/trunk/src/engine/Transaction.h	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/src/engine/Transaction.h	2007-06-25 17:18:28 UTC (rev 16212)
@@ -567,9 +567,9 @@
 /** \deprecated */
 #define xaccTransGetBook(X)      qof_instance_get_book (QOF_INSTANCE(X))
 /** \deprecated */
-#define xaccTransGetGUID(X)      qof_instance_get_guid(QOF_INSTANCE(X))
+#define xaccTransGetGUID(X)      qof_entity_get_guid(QOF_INSTANCE(X))
 /** \deprecated */
-#define xaccTransReturnGUID(X) (X ? *(qof_instance_get_guid(QOF_INSTANCE(X))) : *(guid_null()))
+#define xaccTransReturnGUID(X) (X ? *(qof_entity_get_guid(QOF_INSTANCE(X))) : *(guid_null()))
 /** \deprecated */
 #define xaccTransGetSlots(X)     qof_instance_get_slots (QOF_INSTANCE(X))
 

Modified: gnucash/trunk/src/engine/gnc-budget.h
===================================================================
--- gnucash/trunk/src/engine/gnc-budget.h	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/src/engine/gnc-budget.h	2007-06-25 17:18:28 UTC (rev 16212)
@@ -105,7 +105,7 @@
 
 const GUID* gnc_budget_get_guid(GncBudget* budget);
 #define gnc_budget_return_guid(X) \
-  (X ? *(qof_instance_get_guid(QOF_INSTANCE(X))) : *(guid_null()))
+  (X ? *(qof_entity_get_guid(QOF_INSTANCE(X))) : *(guid_null()))
 
 /** Set/Get the name of the Budget */
 void gnc_budget_set_name(GncBudget* budget, const gchar* name);

Modified: gnucash/trunk/src/engine/gnc-lot.c
===================================================================
--- gnucash/trunk/src/engine/gnc-lot.c	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/src/engine/gnc-lot.c	2007-06-25 17:18:28 UTC (rev 16212)
@@ -440,7 +440,7 @@
           (QofAccessFunc) gnc_lot_get_notes, 
           (QofSetterFunc) gnc_lot_set_notes },
         { QOF_PARAM_GUID, QOF_TYPE_GUID, 
-          (QofAccessFunc) qof_instance_get_guid, NULL },
+          (QofAccessFunc) qof_entity_get_guid, NULL },
         { QOF_PARAM_BOOK, QOF_ID_BOOK, 
           (QofAccessFunc) gnc_lot_get_book, NULL },
         { LOT_IS_CLOSED, QOF_TYPE_BOOLEAN, 

Modified: gnucash/trunk/src/engine/gnc-lot.h
===================================================================
--- gnucash/trunk/src/engine/gnc-lot.h	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/src/engine/gnc-lot.h	2007-06-25 17:18:28 UTC (rev 16212)
@@ -156,7 +156,7 @@
  * */
 KvpFrame * gnc_lot_get_slots (const GNCLot *);
 
-#define gnc_lot_get_guid(X)  qof_instance_get_guid(QOF_INSTANCE(X))
+#define gnc_lot_get_guid(X)  qof_entity_get_guid(QOF_INSTANCE(X))
 
 #define LOT_IS_CLOSED	"is-closed?"
 #define LOT_BALANCE	"balance"

Modified: gnucash/trunk/src/engine/gnc-pricedb.h
===================================================================
--- gnucash/trunk/src/engine/gnc-pricedb.h	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/src/engine/gnc-pricedb.h	2007-06-25 17:18:28 UTC (rev 16212)
@@ -227,8 +227,8 @@
 gnc_numeric     gnc_price_get_value(const GNCPrice *p);
 gboolean        gnc_price_equal(const GNCPrice *p1, const GNCPrice *p2);
 
-#define gnc_price_get_guid(X)    qof_instance_get_guid(QOF_INSTANCE(X))
-#define gnc_price_return_guid(X) (*(qof_instance_get_guid(QOF_INSTANCE(X))))
+#define gnc_price_get_guid(X)    qof_entity_get_guid(QOF_INSTANCE(X))
+#define gnc_price_return_guid(X) (*(qof_entity_get_guid(QOF_INSTANCE(X))))
 #define gnc_price_get_book(X)    qof_instance_get_book(QOF_INSTANCE(X))
 /**  @} */
 

Modified: gnucash/trunk/src/gnome/dialog-chart-export.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-chart-export.c	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/src/gnome/dialog-chart-export.c	2007-06-25 17:18:28 UTC (rev 16212)
@@ -75,7 +75,7 @@
 	{
 		success = qof_instance_copy_to_session(data->chart_session, ent);
 		if(!success) { return; }
-		guid = qof_instance_get_guid(ent);
+		guid = qof_entity_get_guid(ent);
 		book = qof_session_get_book(data->chart_session);
 		copy_coll = qof_book_get_collection(book, GNC_ID_ACCOUNT);
 		data->equity_account = (Account*)qof_collection_lookup_entity(copy_coll, guid);
@@ -119,7 +119,7 @@
 	data = (chart_data*)user_data;
 	trans_time = data->chart_time_t;
 	data->param_ref_list = NULL;
-	guid = qof_instance_get_guid(ent);
+	guid = qof_entity_get_guid(ent);
 	acc_ent = (Account*)ent;
 	ref = NULL;
 	equity_account = data->equity_account;

Modified: gnucash/trunk/src/gnome/top-level.c
===================================================================
--- gnucash/trunk/src/gnome/top-level.c	2007-06-25 17:18:11 UTC (rev 16211)
+++ gnucash/trunk/src/gnome/top-level.c	2007-06-25 17:18:28 UTC (rev 16212)
@@ -230,7 +230,7 @@
     
     /* Get the book GUID */
     book = qof_session_get_book(session);
-    guid = qof_instance_get_guid(QOF_INSTANCE(book));
+    guid = qof_entity_get_guid(QOF_INSTANCE(book));
     guid_string = guid_to_string(guid);
     
     keyfile = gnc_find_state_file(url, guid_string, &filename);
@@ -317,7 +317,7 @@
 
     /* Get the book GUID */
     book = qof_session_get_book(session);
-    guid = qof_instance_get_guid(QOF_INSTANCE(book));
+    guid = qof_entity_get_guid(QOF_INSTANCE(book));
     guid_string = guid_to_string(guid);
 
     /* Find the filename to use.  This returns the data from the



More information about the gnucash-changes mailing list