diff options
author | Guido Günther <agx@sigxcpu.org> | 2009-05-25 18:39:27 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2009-05-25 18:39:27 +0200 |
commit | d911517dc2f9c4c3ce57529ac4d64c17185544e9 (patch) | |
tree | b4f7a09a3cf84ac25b3cabdcf74fb448ef82eb53 /src/krb5-auth-gconf-tools.c | |
parent | Imported Upstream version 0.9.1 (diff) | |
download | krb5-auth-dialog-d911517dc2f9c4c3ce57529ac4d64c17185544e9.tar.gz krb5-auth-dialog-d911517dc2f9c4c3ce57529ac4d64c17185544e9.tar.bz2 krb5-auth-dialog-d911517dc2f9c4c3ce57529ac4d64c17185544e9.zip |
Imported Upstream version 0.10
Diffstat (limited to 'src/krb5-auth-gconf-tools.c')
-rw-r--r-- | src/krb5-auth-gconf-tools.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/krb5-auth-gconf-tools.c b/src/krb5-auth-gconf-tools.c index fb67999..01f4d39 100644 --- a/src/krb5-auth-gconf-tools.c +++ b/src/krb5-auth-gconf-tools.c @@ -31,6 +31,7 @@ ka_gconf_get_string (GConfClient* client, gboolean success = FALSE; GConfValue* gc_value; + g_return_val_if_fail (client != NULL, FALSE); g_return_val_if_fail (key != NULL, FALSE); g_return_val_if_fail (*value == NULL, FALSE); @@ -39,7 +40,7 @@ ka_gconf_get_string (GConfClient* client, *value = g_strdup (gconf_value_get_string (gc_value)); success = TRUE; } else if (error) { - g_print (error->message); + g_print ("%s", error->message); g_error_free (error); } gconf_value_free (gc_value); @@ -57,6 +58,7 @@ ka_gconf_get_int (GConfClient* client, gboolean success = FALSE; GConfValue* gc_value; + g_return_val_if_fail (client != NULL, FALSE); g_return_val_if_fail (key != NULL, FALSE); g_return_val_if_fail (value != NULL, FALSE); @@ -66,7 +68,7 @@ ka_gconf_get_int (GConfClient* client, *value = gconf_value_get_int (gc_value); success = TRUE; } else if (error) { - g_print (error->message); + g_print ("%s", error->message); g_error_free (error); } gconf_value_free (gc_value); @@ -84,6 +86,7 @@ ka_gconf_get_bool (GConfClient* client, gboolean success = FALSE; GConfValue* gc_value; + g_return_val_if_fail (client != NULL, FALSE); g_return_val_if_fail (key != NULL, FALSE); g_return_val_if_fail (value != NULL, FALSE); @@ -92,7 +95,7 @@ ka_gconf_get_bool (GConfClient* client, *value = gconf_value_get_bool (gc_value); success = TRUE; } else if (error) { - g_print (error->message); + g_print ("%s", error->message); g_error_free (error); } gconf_value_free (gc_value); @@ -100,3 +103,24 @@ ka_gconf_get_bool (GConfClient* client, return success; } + +gboolean +ka_gconf_set_bool (GConfClient* client, + const char* key, + gboolean value) +{ + GError* error = NULL; + + g_return_val_if_fail (client != NULL, FALSE); + g_return_val_if_fail (key != NULL, FALSE); + + if(!gconf_client_set_bool (client, key, value, &error)) { + if (error) { + g_print ("%s", error->message); + g_error_free (error); + } + return FALSE; + } + return TRUE; +} + |