Re: gnome games without gnome (osx, win32)



On 2/8/07, Callum McKenzie <callum spooky-possum org> wrote:

[...]

The appropriate response to for a missing gconf is for the app to fall
back to some internal default since, the mere availability of gconf
isn't enough to guarantee reliable answers form it. We already have some
wrapper code for gconf that is used a little in gnome-games and could
probably be expanded. Ross Burton wrote it a while back - it is in the
libgames-support directory.

I have found only these two functions in games-gconf.h
gboolean games_gconf_sanity_check_string (GConfClient * client, const
gchar * key);
gchar *games_gconf_get_string (GConfClient * client, const gchar *
key, const gchar * def);

A simpler idea would be to write a simple header replacement for gconf.h
which replaced the functions with no-ops and returned dud data for those
that do return a value. At one stage all of gnome-games could handle a
failed gconf system so it should work even if a few bugs have crept back
in.

That way the #ifdefs could be reduced to:

#if HAVE_GNOME
#include <gconf/gconf.h>
#else
#include <null-gconf.h>
#endif

I'd prefer if the fallback handling was done inside a gconf wrapper,
to avoid cluttering the existing source code. To this end I have
started writing some code that wraps
   get/set_boolean()
   get/set_float()
   get/set_int()
   get/set_string()
The gconf-based "backend" is pretty much done, what's missing is a
simple file-based one, list- and change-notification handling:
http://www.abisource.com/~robsta/gconf-wrapper/gconf-wrapper.tgz

What I'd like to support too is loading defaults from a gconf
"schema.in" file to cover present but non-functional gconf. Also
there's not build system yet (just a Makefile), need to make up my
mind whether this handful files justify the creation of a shared lib.

- Rob



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]