[krb5-auth-dialog] Add gconf helper to fetch a list of strings



commit 14c574f60f33f03b5c92b902479bfd1cd3d95b12
Author: Guido Günther <agx sigxcpu org>
Date:   Sat Apr 24 22:28:29 2010 +0200

    Add gconf helper to fetch a list of strings

 src/krb5-auth-gconf-tools.c |   24 ++++++++++++++++++++++++
 src/krb5-auth-gconf-tools.h |    1 +
 2 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/src/krb5-auth-gconf-tools.c b/src/krb5-auth-gconf-tools.c
index 01f4d39..48d7e58 100644
--- a/src/krb5-auth-gconf-tools.c
+++ b/src/krb5-auth-gconf-tools.c
@@ -50,6 +50,30 @@ ka_gconf_get_string (GConfClient* client,
 
 
 gboolean
+ka_gconf_get_string_list (GConfClient* client,
+		          const char* key,
+		          GSList** list)
+{
+	GError*		error = NULL;
+	gboolean	success = FALSE;
+
+	g_return_val_if_fail (client != NULL, FALSE);
+	g_return_val_if_fail (key != NULL, FALSE);
+	g_return_val_if_fail (*list == NULL, FALSE);
+
+	if ((*list = gconf_client_get_list (client, key,
+	                                   GCONF_VALUE_STRING, &error))) {
+		if (error) {
+			g_print ("%s", error->message);
+			g_error_free (error);
+		} else
+			success = TRUE;
+	}
+	return success;
+}
+
+
+gboolean
 ka_gconf_get_int (GConfClient* client,
 		    const char* key,
 		    int* value)
diff --git a/src/krb5-auth-gconf-tools.h b/src/krb5-auth-gconf-tools.h
index 6d9f124..10e50aa 100644
--- a/src/krb5-auth-gconf-tools.h
+++ b/src/krb5-auth-gconf-tools.h
@@ -39,6 +39,7 @@
 #define KA_GCONF_KEY_NOTIFY_EXPIRING	KA_GCONF_PATH "/notify/expiring"
 
 gboolean ka_gconf_get_string (GConfClient* client, const char* key, char** value);
+gboolean ka_gconf_get_string_list (GConfClient* client, const char* key, GSList** list);
 gboolean ka_gconf_get_int (GConfClient* client, const char* key, int* value);
 gboolean ka_gconf_get_bool (GConfClient* client, const char* key, gboolean* value);
 gboolean ka_gconf_set_bool (GConfClient* client, const char* key, gboolean value);



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