[Gnucash-changes] Make a session sort of look like a QofEntity.

Derek Atkins warlord at cvs.gnucash.org
Wed Jun 8 15:17:38 EDT 2005


Log Message:
-----------
Make a session sort of look like a QofEntity.

	* src/engine/qofsession-p.h, src/engine/qofsession.c:
	  Make a session sort of look like a QofEntity.  This will
	  be useful when I add scheme bindings to the hooks.

Tags:
----
gnucash-gnome2-dev

Modified Files:
--------------
    gnucash:
        ChangeLog
    gnucash/src/engine:
        qofsession-p.h
        qofsession.c

Revision Data
-------------
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1487.2.220
retrieving revision 1.1487.2.221
diff -LChangeLog -LChangeLog -u -r1.1487.2.220 -r1.1487.2.221
--- ChangeLog
+++ ChangeLog
@@ -9,6 +9,10 @@
 	* src/gnome/top-level.c:
 	  point to new gnc-hook function names
 
+	* src/engine/qofsession-p.h, src/engine/qofsession.c:
+	  Make a session sort of look like a QofEntity.  This will
+	  be useful when I add scheme bindings to the hooks.
+
 2005-06-07  David Hampton  <hampton at employees.org>
 
 	* src/gnome/gnc-plugin-page-register.c:
Index: qofsession.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/qofsession.c,v
retrieving revision 1.2.4.17
retrieving revision 1.2.4.18
diff -Lsrc/engine/qofsession.c -Lsrc/engine/qofsession.c -u -r1.2.4.17 -r1.2.4.18
--- src/engine/qofsession.c
+++ src/engine/qofsession.c
@@ -209,6 +209,7 @@
 {
   if (!session) return;
 
+  session->entity->e_type = QOF_ID_SESSION;
   session->books = g_list_append (NULL, qof_book_new ());
   session->book_id = NULL;
   session->backend = NULL;
Index: qofsession-p.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/qofsession-p.h,v
retrieving revision 1.2.4.4
retrieving revision 1.2.4.5
diff -Lsrc/engine/qofsession-p.h -Lsrc/engine/qofsession-p.h -u -r1.2.4.4 -r1.2.4.5
--- src/engine/qofsession-p.h
+++ src/engine/qofsession-p.h
@@ -31,9 +31,16 @@
 
 #include "qofbook.h"
 #include "qofsession.h"
+#include "qofid.h"
 
 struct _QofSession
 {
+  /* This is just a "fake" entry point to allow me to pass a Session as
+   * an Entity.  NOTE:  THIS IS NOT AN ENTITY!  THE ONLY PART OF ENTITY
+   * THAT IS VALID IS E_TYPE!
+   */
+  QofEntity entity;
+
   /* A book holds pointers to the various types of datasets used
    * by GnuCash.  A session may have open multiple books.  */
   GList *books;


More information about the gnucash-changes mailing list