[Gnucash-changes] r13277 - gnucash/trunk - move jsled's g-type
initialization into the module init
Derek Atkins
warlord at cvs.gnucash.org
Wed Feb 15 23:50:38 EST 2006
Author: warlord
Date: 2006-02-15 23:50:37 -0500 (Wed, 15 Feb 2006)
New Revision: 13277
Trac: http://svn.gnucash.org/trac/changeset/13277
Modified:
gnucash/trunk/ChangeLog
gnucash/trunk/src/backend/file/gncmod-backend-file.c
gnucash/trunk/src/backend/file/test/test-load-xml2.c
Log:
move jsled's g-type initialization into the module init
this way we don't need to worry about it in every test app.
Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog 2006-02-16 04:31:37 UTC (rev 13276)
+++ gnucash/trunk/ChangeLog 2006-02-16 04:50:37 UTC (rev 13277)
@@ -14,6 +14,11 @@
* configure.in:
combine XML_{CFLAGS,LIBS} into LIBXML2_{CLFLAGS,LIBS}
+ * src/backend/file/test/test-load-xml2.c:
+ * src/backend/file/gncmod-file-backend.c:
+ move jsled's g-type initialization into the module init
+ this way we don't need to worry about it in every test app.
+
2006-02-15 Joshua Sled <jsled at asynchronous.org>
* src/backend/file/test/test-load-xml2.c (main): Initialize
Modified: gnucash/trunk/src/backend/file/gncmod-backend-file.c
===================================================================
--- gnucash/trunk/src/backend/file/gncmod-backend-file.c 2006-02-16 04:31:37 UTC (rev 13276)
+++ gnucash/trunk/src/backend/file/gncmod-backend-file.c 2006-02-16 04:50:37 UTC (rev 13277)
@@ -7,6 +7,7 @@
#include <stdio.h>
#include <glib.h>
+#include <glib-gobject.h>
#include "gnc-module.h"
#include "gnc-module-api.h"
@@ -46,6 +47,10 @@
engine = gnc_module_load("gnucash/engine", 0);
if(!engine) return FALSE;
+ /* Need to initialize g-type engine for gconf */
+ if (refcount == 0)
+ g_type_init();
+
return TRUE;
}
Modified: gnucash/trunk/src/backend/file/test/test-load-xml2.c
===================================================================
--- gnucash/trunk/src/backend/file/test/test-load-xml2.c 2006-02-16 04:31:37 UTC (rev 13276)
+++ gnucash/trunk/src/backend/file/test/test-load-xml2.c 2006-02-16 04:50:37 UTC (rev 13277)
@@ -34,7 +34,6 @@
#include <dirent.h>
#include <string.h>
#include <glib.h>
-#include <glib-object.h>
#include "cashobjects.h"
#include "Group.h"
@@ -109,8 +108,6 @@
const char *location = getenv("GNC_TEST_FILES");
DIR *xml2_dir;
- g_type_init();
-
qof_init();
cashobjects_register();
do_test(
More information about the gnucash-changes
mailing list