
// gcc -o gconf-test `pkg-config --libs --cflags gtk+-2.0 gconf-2.0` gconf-test.c

#include <gconf/gconf-client.h>

#define KEY "/desktop/gnome/url-handlers/http/enabled"

int main (int argc, char **argv)
{
	GConfClient *gc;
	GConfValue *value;
	gboolean boolean;
	GError *error = NULL;

	gtk_init (&argc, &argv);

	gc = gconf_client_get_default ();
	if (gc == NULL) {
		g_warning ("gc is nil!");
		return 1;
	}

	boolean = gconf_client_get_bool (gc, KEY, &error);
	g_print ("got %d\n", boolean);
	gconf_client_clear_cache (gc);
	boolean = gconf_client_get_bool (gc, KEY, &error);
	g_print ("got %d\n", boolean);

	value = gconf_client_get_without_default (gc, KEY,
			&error);
	if (value == NULL) {
		if (error != NULL)
			g_warning ("error getting the conf value: %s", error->message);
		else
			g_warning ("error getting the conf value, no reason");
		return 1;
	}

	g_print ("value: %d\n", gconf_value_get_bool (value));

	return 0;
}

