summaryrefslogtreecommitdiff
path: root/wrappers
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>1999-12-01 23:51:51 +0000
committerHavoc Pennington <hp@src.gnome.org>1999-12-01 23:51:51 +0000
commitdc6fbba28bf64a9825a0e38e4e329dd5ea99566f (patch)
treefb586d3fb163994eec455d7fc97fb86dcf2e6e2e /wrappers
parent35e5316e517d9cff8ac2f2b705f38a2321715a67 (diff)
downloadgconf-dc6fbba28bf64a9825a0e38e4e329dd5ea99566f.tar.gz
Add new create_change_set functions for GConfClient and GConfEngine
1999-12-01 Havoc Pennington <hp@pobox.com> * doc/gconf/gconf-sections.txt: Add new create_change_set functions for GConfClient and GConfEngine * doc/gconf/Makefile.am (LDFLAGS): Use proper cflags/ldflags for gtk and OAF when doing 'make scan' * wrappers/gtk/testgconfclient.c (entry_attached_to): change for new get_string() thing * gconf/gconf-changeset.h: fix the "" vs. <> issue on an #include * wrappers/gtk/gconf-client.c (gconf_client_get_bool): remove "default" argument (gconf_client_get_string): ditto (gconf_client_get_int): ditto (gconf_client_get_float): ditto * gconf/gconf.c (gconf_get_bool): Remove "default" argument. (gconf_get_string): ditto (gconf_get_int): ditto (gconf_get_float): ditto
Diffstat (limited to 'wrappers')
-rw-r--r--wrappers/gtk/gconf-client.c11
-rw-r--r--wrappers/gtk/gconf-client.h14
-rw-r--r--wrappers/gtk/testgconfclient.c8
3 files changed, 15 insertions, 18 deletions
diff --git a/wrappers/gtk/gconf-client.c b/wrappers/gtk/gconf-client.c
index dc98b8fd..915f63ea 100644
--- a/wrappers/gtk/gconf-client.c
+++ b/wrappers/gtk/gconf-client.c
@@ -753,8 +753,9 @@ gconf_client_get (GConfClient* client,
gdouble
gconf_client_get_float (GConfClient* client, const gchar* key,
- gdouble def, GConfError** err)
+ GConfError** err)
{
+ static const gdouble def = 0.0;
GConfError* error = NULL;
GConfValue* val;
@@ -787,8 +788,9 @@ gconf_client_get_float (GConfClient* client, const gchar* key,
gint
gconf_client_get_int (GConfClient* client, const gchar* key,
- gint def, GConfError** err)
+ GConfError** err)
{
+ static const gint def = 0;
GConfError* error = NULL;
GConfValue* val;
@@ -821,9 +823,9 @@ gconf_client_get_int (GConfClient* client, const gchar* key,
gchar*
gconf_client_get_string(GConfClient* client, const gchar* key,
- const gchar* def,
GConfError** err)
{
+ static const gchar* def = NULL;
GConfError* error = NULL;
GConfValue* val;
@@ -863,8 +865,9 @@ gconf_client_get_string(GConfClient* client, const gchar* key,
gboolean
gconf_client_get_bool (GConfClient* client, const gchar* key,
- gboolean def, GConfError** err)
+ GConfError** err)
{
+ static const gboolean def = FALSE;
GConfError* error = NULL;
GConfValue* val;
diff --git a/wrappers/gtk/gconf-client.h b/wrappers/gtk/gconf-client.h
index bfc74952..56c17a95 100644
--- a/wrappers/gtk/gconf-client.h
+++ b/wrappers/gtk/gconf-client.h
@@ -252,24 +252,18 @@ gboolean gconf_client_dir_exists (GConfClient* client,
/* Get/Set convenience wrappers */
-/* 'def' (default) is used if the key is not set or if there's an error. */
-
gdouble gconf_client_get_float (GConfClient* client, const gchar* key,
- gdouble def, GConfError** err);
+ GConfError** err);
gint gconf_client_get_int (GConfClient* client, const gchar* key,
- gint def, GConfError** err);
+ GConfError** err);
-/* free the retval */
+/* free the retval, if non-NULL */
gchar* gconf_client_get_string(GConfClient* client, const gchar* key,
- const gchar* def, /* def is copied when returned,
- * and can be NULL to return
- * NULL
- */
GConfError** err);
gboolean gconf_client_get_bool (GConfClient* client, const gchar* key,
- gboolean def, GConfError** err);
+ GConfError** err);
/* this one has no default since it would be expensive and make little
sense; it returns NULL as a default, to indicate unset or error */
diff --git a/wrappers/gtk/testgconfclient.c b/wrappers/gtk/testgconfclient.c
index 387bb8f8..83922141 100644
--- a/wrappers/gtk/testgconfclient.c
+++ b/wrappers/gtk/testgconfclient.c
@@ -111,12 +111,12 @@ entry_attached_to(GConfClient* client, const gchar* key)
g_strdup(key), g_free);
- val = gconf_client_get_string(client, key, "<<default value, unset>>", NULL);
+ val = gconf_client_get_string(client, key, NULL);
- g_assert(val != NULL);
-
- gtk_entry_set_text(GTK_ENTRY(entry), val);
+ gtk_entry_set_text(GTK_ENTRY(entry), val ? val : "");
+ g_free(val);
+
notify_id = gconf_client_notify_add(client, key, entry_notify_func, entry, NULL, NULL);
gtk_object_set_data(GTK_OBJECT(entry), "notify_id",