X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmodest-conf.c;h=019b16826535a124102363604889f490146d4296;hb=ff83139654ddf5b8e297b75ce43f7c201214920e;hp=f1d4694a984bd9130b9bdf93806760dc2fba0f23;hpb=c0d1c43e9e48abc7d867cabcd57ccc9a6917a41b;p=modest diff --git a/src/modest-conf.c b/src/modest-conf.c index f1d4694..019b168 100644 --- a/src/modest-conf.c +++ b/src/modest-conf.c @@ -32,6 +32,7 @@ #include #include "modest-conf.h" #include "modest-marshal.h" +#include static void modest_conf_class_init (ModestConfClass *klass); static void modest_conf_init (ModestConf *obj); @@ -228,7 +229,6 @@ modest_conf_get_list (ModestConf* self, const gchar* key, ModestConfValueType li { ModestConfPrivate *priv; GConfValueType gconf_type; - GSList *retval = NULL; g_return_val_if_fail (self, NULL); g_return_val_if_fail (key, NULL); @@ -237,10 +237,7 @@ modest_conf_get_list (ModestConf* self, const gchar* key, ModestConfValueType li gconf_type = modest_conf_type_to_gconf_type (list_type, err); - if (!err) - retval = gconf_client_get_list (priv->gconf_client, key, gconf_type, err); - - return retval; + return gconf_client_get_list (priv->gconf_client, key, gconf_type, err); } @@ -320,10 +317,30 @@ modest_conf_set_list (ModestConf* self, const gchar* key, priv = MODEST_CONF_GET_PRIVATE(self); gconf_type = modest_conf_type_to_gconf_type (list_type, err); - if (err) + if (*err) return FALSE; - return gconf_client_set_list (priv->gconf_client, key, gconf_type, val, err); + + gboolean result = gconf_client_set_list (priv->gconf_client, key, gconf_type, val, err); + if(*err) { + g_warning("gconf_client_set_list() failed with key=%s. error=%s", key, (*err)->message); + result = FALSE; + } + + /* TODO: Remove this, when we fix the problem: */ + /* This shows that sometimes set_list fails, while saying that it succeeded: */ + if (result) { + const gint debug_list_length_start = g_slist_length(val); + GSList* debug_list = gconf_client_get_list(priv->gconf_client, key, gconf_type, err); + const gint debug_list_length_after = g_slist_length(debug_list); + + if(debug_list_length_start != debug_list_length_after) + g_warning("modest_conf_set_list(): The list length after setting is not the same as the specified list. key=%s", key); + + g_slist_free(debug_list); + } + + return result; } @@ -388,7 +405,8 @@ gchar* modest_conf_key_escape (const gchar* key) { g_return_val_if_fail (key, NULL); - + g_return_val_if_fail (strlen (key) > 0, g_strdup (key)); + return gconf_escape_key (key, strlen(key)); } @@ -408,8 +426,7 @@ modest_conf_key_is_valid (const gchar* key) } - - +/* hmmm... might need to make specific callback for specific keys */ static void modest_conf_on_change (GConfClient *client, guint conn_id, GConfEntry *entry, gpointer data)