gconf and gtkhtml
Robert Stephenson
parys@usa.net
Thu, 29 Mar 2001 10:15:22 +0200
This is a multipart MIME message.
--==_Exmh_-17028547260
Content-Type: text/plain; charset=us-ascii
Hi,
Since I wasn't subscribed to this list the first time I sent the patch, I'm
resending the email. So whoever moderates the list can just ignore my first
email sitting in their moderation pile.
I'm using the packages from Mandrake Cooker on my computer, and I've been
having trouble in running the unstable version of gnucash. Everything
compiles OK, but when I try to open anything with a gtkhtml widget, it
crashes with this error:
gtkhtml-ERROR **: gconf is not initialized, please call gconf_init before
using GtkHTML library
Based on something I found in the Gnome Mailing List archives,
http://mail.gnome.org/archives/balsa-list/2000-August/msg00148.html I patched
Gnucash-1.5.3 to work for me. The fix in the mailing list is way outdated,
the GConf_Error struct is gone away instead for a GError. I don't have an
internet connection at the moment for my laptop, which is why the patch is
against gnucash-1.5.3 and not against CVS.
Basically, I think the version of gtkhtml in Cooker is compiled with GConf
support and so gconf_init() needs to be called. I wasn't sure whether to use
restargc and restargv from gnucash_ui_init or put the fix somewhere with argc
and argv, but this seems to work. Since it's so simple, I didn't run the
whole make-patch program. A simple diff -u of src/gnome/top-level.c is
attached. If whoever could take a look at it and see if this could be added,
that would be great!
Robby Stephenson
--==_Exmh_-17028547260
Content-Type: text/plain ; name="gnucash.diff"; charset=us-ascii
Content-Description: gnucash.diff
Content-Disposition: attachment; filename="gnucash.diff"
--- top-level.c.orig Fri Feb 16 06:39:19 2001
+++ top-level.c Thu Mar 29 09:38:23 2001
@@ -32,6 +32,9 @@
#endif
#include <popt.h>
#include <stdlib.h>
+#ifdef GTKHTML_HAVE_GCONF
+#include <gconf/gconf.h>
+#endif
#include "AccWindow.h"
#include "FileBox.h"
@@ -175,6 +178,10 @@
char **restargv2;
poptContext returnedPoptContext;
+#ifdef GTKHTML_HAVE_GCONF
+ GError *gerror;
+#endif
+
ENTER ("\n");
/* We're going to have to have other ways to handle X and GUI
@@ -197,6 +204,12 @@
restargv2 = (char**)poptGetArgs(returnedPoptContext);
gnc_set_remaining_argv(argv_length(restargv2), (const char**)restargv2);
+
+#ifdef GTKHTML_HAVE_GCONF
+ if( !gconf_init(restargc, restargv, &gerror) )
+ g_error_free(gerror);
+ gerror = NULL;
+#endif
/* this must come after using the poptGetArgs return value */
poptFreeContext (returnedPoptContext);