+
+ModestConfNotificationId
+modest_conf_listen_to_namespace (ModestConf *self,
+ const gchar *namespace)
+{
+ ModestConfPrivate *priv;
+ GError *error = NULL;
+ ModestConfNotificationId notification_id;
+
+ g_return_val_if_fail (MODEST_IS_CONF (self), 0);
+ g_return_val_if_fail (namespace, 0);
+
+ priv = MODEST_CONF_GET_PRIVATE(self);
+
+ /* Add the namespace to the list of the namespaces that will
+ be observed */
+ gconf_client_add_dir (priv->gconf_client, namespace,
+ GCONF_CLIENT_PRELOAD_NONE,
+ &error);
+
+ if (error)
+ return 0;
+
+ /* Notify every change under namespace */
+ notification_id = gconf_client_notify_add (priv->gconf_client,
+ namespace,
+ modest_conf_on_change,
+ self,
+ NULL,
+ &error);
+ if (error)
+ return 0;
+ else
+ return notification_id;
+}
+
+void
+modest_conf_forget_namespace (ModestConf *self,
+ const gchar *namespace,
+ ModestConfNotificationId id)
+{
+ ModestConfPrivate *priv;
+
+ g_return_if_fail (MODEST_IS_CONF (self));
+ g_return_if_fail (namespace);
+
+ priv = MODEST_CONF_GET_PRIVATE(self);
+
+ /* Remove the namespace to the list of the namespaces that will
+ be observed */
+ gconf_client_remove_dir (priv->gconf_client, namespace, NULL);
+
+ /* Notify every change under namespace */
+ gconf_client_notify_remove (priv->gconf_client, id);
+}