gconf_client_recursive_unset



Hi

I was in need of removing a GConf directory from my code, which uses
GConfClient, and didn't find anything apart from
gconf_engine_recursive_unset.

So, here's a patch that adds gconf_client_recursive_unset function. Just
tested for my particular case, and it worked perfectly.

Also, I've added gconf-sources.h to the list of header files to install,
since GConfUnsetFlags is defined there, and is needed by the new
prototype in gconf-client.h

Can I commit?

cheers
-- 
Rodrigo Moya <rodrigo gnome-db org> - <rodrigo ximian com>
http://www.gnome-db.org/ - http://www.ximian.com/
? gconf/gconf-sanity-check-2
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gconf/ChangeLog,v
retrieving revision 1.369
diff -u -r1.369 ChangeLog
--- ChangeLog	2002/02/26 16:43:38	1.369
+++ ChangeLog	2002/03/03 18:24:03
@@ -1,3 +1,9 @@
+2002-03-03  Rodrigo Moya <rodrigo gnome-db org>
+
+	* gconf/gconf-client.[ch] (gconf_client_recursive_unset): implemented.
+
+	* gconf/Makefile.am: install gconf-sources, needed by gconf-client.h.
+
 2002-02-26  Havoc Pennington  <hp redhat com>
 
 	* gconf/gconf-client.c (notify_one_entry): protect notify callback 
Index: gconf/Makefile.am
===================================================================
RCS file: /cvs/gnome/gconf/gconf/Makefile.am,v
retrieving revision 1.75
diff -u -r1.75 Makefile.am
--- gconf/Makefile.am	2002/02/07 21:13:57	1.75
+++ gconf/Makefile.am	2002/03/03 18:24:03
@@ -56,6 +56,7 @@
 	gconf-changeset.h	\
 	gconf-listeners.h	\
 	gconf-schema.h		\
+	gconf-sources.h		\
 	gconf-value.h		\
 	gconf-error.h		\
 	gconf-engine.h		\
Index: gconf/gconf-client.c
===================================================================
RCS file: /cvs/gnome/gconf/gconf/gconf-client.c,v
retrieving revision 1.54
diff -u -r1.54 gconf-client.c
--- gconf/gconf-client.c	2002/02/26 16:43:45	1.54
+++ gconf/gconf-client.c	2002/03/03 18:24:04
@@ -1005,6 +1005,28 @@
     return TRUE;
 }
 
+gboolean
+gconf_client_recursive_unset (GConfClient *client,
+                              const char     *key,
+                              GConfUnsetFlags flags,
+                              GError        **err)
+{
+  GError* error = NULL;
+
+  trace ("Unsetting '%s'\n", key);
+  
+  PUSH_USE_ENGINE (client);
+  gconf_engine_recursive_unset(client->engine, key, flags, &error);
+  POP_USE_ENGINE (client);
+  
+  handle_error(client, error, err);
+
+  if (error != NULL)
+    return FALSE;
+  else
+    return TRUE;
+}
+
 static GSList*
 copy_entry_list (GSList *list)
 {
@@ -2339,8 +2361,8 @@
                           gpointer listener_data,
                           gpointer user_data)
 {
-  struct ClientAndEntry* cae = user_data;
   Listener* l = listener_data;
+  struct ClientAndEntry* cae = user_data;
   
   g_return_if_fail (cae != NULL);
   g_return_if_fail (cae->client != NULL);
Index: gconf/gconf-client.h
===================================================================
RCS file: /cvs/gnome/gconf/gconf/gconf-client.h,v
retrieving revision 1.29
diff -u -r1.29 gconf-client.h
--- gconf/gconf-client.h	2002/01/23 19:56:25	1.29
+++ gconf/gconf-client.h	2002/03/03 18:24:06
@@ -25,6 +25,7 @@
 #include <gconf/gconf.h>
 #include <gconf/gconf-listeners.h>
 #include <gconf/gconf-changeset.h>
+#include <gconf/gconf-sources.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -256,6 +257,11 @@
 
 gboolean     gconf_client_unset          (GConfClient* client,
                                           const gchar* key, GError** err);
+
+gboolean     gconf_client_recursive_unset (GConfClient *client,
+                                           const char     *key,
+                                           GConfUnsetFlags flags,
+                                           GError        **err);
 
 GSList*      gconf_client_all_entries    (GConfClient* client,
                                           const gchar* dir, GError** err);


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