* fix for modest_conf_key_exists, which did not work correctly on leaf nodes
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Mon, 24 Jul 2006 14:35:37 +0000 (14:35 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Mon, 24 Jul 2006 14:35:37 +0000 (14:35 +0000)
pmo-trunk-r413

src/modest-conf.c

index 1d92571..3bffdfb 100644 (file)
@@ -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;
+       }       
 }