From: Dirk-Jan C. Binnema Date: Mon, 24 Jul 2006 14:35:37 +0000 (+0000) Subject: * fix for modest_conf_key_exists, which did not work correctly on leaf nodes X-Git-Tag: git_migration_finished~4463 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=6a4aa176df337ae348cc07284a4a3efd8988d14c * fix for modest_conf_key_exists, which did not work correctly on leaf nodes pmo-trunk-r413 --- diff --git a/src/modest-conf.c b/src/modest-conf.c index 1d92571..3bffdfb 100644 --- a/src/modest-conf.c +++ b/src/modest-conf.c @@ -359,19 +359,30 @@ modest_conf_remove_key (ModestConf* self, const gchar* key, GError **err) } - - gboolean modest_conf_key_exists (ModestConf* self, const gchar* key, GError **err) { ModestConfPrivate *priv; - + gboolean dir_exists; + GConfValue *val; + const gchar *str; + g_return_val_if_fail (self,FALSE); g_return_val_if_fail (key, FALSE); priv = MODEST_CONF_GET_PRIVATE(self); - - return gconf_client_dir_exists (priv->gconf_client,key,err); + + /* the fast way... */ + if (gconf_client_dir_exists (priv->gconf_client,key,err)) + return TRUE; + + val = gconf_client_get (priv->gconf_client, key, NULL); + if (!val) + return FALSE; + else { + gconf_value_free (val); + return TRUE; + } }