[maemo-commits] [maemo-commits] r12511 - in projects/haf/trunk/gconf2: . debian gconf

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Jun 27 16:06:26 EEST 2007
Author: richard
Date: 2007-06-27 16:06:12 +0300 (Wed, 27 Jun 2007)
New Revision: 12511

Modified:
   projects/haf/trunk/gconf2/ChangeLog
   projects/haf/trunk/gconf2/debian/changelog
   projects/haf/trunk/gconf2/gconf/gconf-database-dbus.c
   projects/haf/trunk/gconf2/gconf/gconf-dbus-utils.h
   projects/haf/trunk/gconf2/gconf/gconf-dbus.c
Log:
Fix NB#60368.

Modified: projects/haf/trunk/gconf2/ChangeLog
===================================================================
--- projects/haf/trunk/gconf2/ChangeLog	2007-06-27 13:01:37 UTC (rev 12510)
+++ projects/haf/trunk/gconf2/ChangeLog	2007-06-27 13:06:12 UTC (rev 12511)
@@ -1,5 +1,12 @@
 2007-06-27  Richard Hult  <richard at imendio.com>
 
+	* gconf/gconf-database-dbus.c: (database_message_func),
+	(database_handle_suggest_sync):
+	* gconf/gconf-dbus.c: (gconf_engine_suggest_sync): Implement
+	suggest_sync.
+
+2007-06-27  Richard Hult  <richard at imendio.com>
+
 	* backends/Makefile.am: Keep in sync with upstream (fix
 	portability).
 

Modified: projects/haf/trunk/gconf2/debian/changelog
===================================================================
--- projects/haf/trunk/gconf2/debian/changelog	2007-06-27 13:01:37 UTC (rev 12510)
+++ projects/haf/trunk/gconf2/debian/changelog	2007-06-27 13:06:12 UTC (rev 12511)
@@ -1,7 +1,8 @@
 gconf2 (2.16.0~unreleased) unstable; urgency=low
 
-  * Partly fixes NB#56587, dh_gconf does not generate .postinst scripts
+  * Partly fixes NB#56587, dh_gconf does not generate .postinst scripts 
   * Fixes: NB#59161, Cannot unapply schema from gconf
+  * Fixes: NB#60368, gconf_{client,engine}_suggest_sync doesn't work
   * Sync with upstream (fix portability)
 
  -- Richard Hult <richard at imendio.com>  Tue, 26 Jun 2007 16:13:53 +0200

Modified: projects/haf/trunk/gconf2/gconf/gconf-database-dbus.c
===================================================================
--- projects/haf/trunk/gconf2/gconf/gconf-database-dbus.c	2007-06-27 13:01:37 UTC (rev 12510)
+++ projects/haf/trunk/gconf2/gconf/gconf-database-dbus.c	2007-06-27 13:06:12 UTC (rev 12511)
@@ -81,6 +81,9 @@
 static void     database_handle_set_schema        (DBusConnection   *conn,
 						   DBusMessage      *message,
 						   GConfDatabase    *db);
+static void     database_handle_suggest_sync      (DBusConnection   *conn,
+						   DBusMessage      *message,
+						   GConfDatabase    *db);
 static void     database_handle_add_notify        (DBusConnection   *conn,
 						   DBusMessage      *message,
 						   GConfDatabase    *db);
@@ -168,6 +171,11 @@
   }
   else if (dbus_message_is_method_call (message,
 					GCONF_DBUS_DATABASE_INTERFACE,
+					GCONF_DBUS_DATABASE_SUGGEST_SYNC)) {
+    database_handle_suggest_sync (connection, message, db);
+  }
+  else if (dbus_message_is_method_call (message,
+					GCONF_DBUS_DATABASE_INTERFACE,
 					GCONF_DBUS_DATABASE_ADD_NOTIFY)) {
 	  database_handle_add_notify (connection, message, db);
   }
@@ -654,6 +662,24 @@
 }
 
 static void
+database_handle_suggest_sync (DBusConnection *conn,
+		              DBusMessage    *message,
+		              GConfDatabase  *db)
+{
+  GError *gerror = NULL;
+  DBusMessage *reply;
+  
+  gconf_database_sync (db, &gerror);
+  
+  if (gconfd_dbus_set_exception (conn, message, &gerror))
+    return;
+
+  reply = dbus_message_new_method_return (message);
+  dbus_connection_send (conn, reply, NULL);
+  dbus_message_unref (reply);
+}
+
+static void
 database_handle_add_notify (DBusConnection    *conn,
                             DBusMessage       *message,
                             GConfDatabase *db)

Modified: projects/haf/trunk/gconf2/gconf/gconf-dbus-utils.h
===================================================================
--- projects/haf/trunk/gconf2/gconf/gconf-dbus-utils.h	2007-06-27 13:01:37 UTC (rev 12510)
+++ projects/haf/trunk/gconf2/gconf/gconf-dbus-utils.h	2007-06-27 13:06:12 UTC (rev 12511)
@@ -46,6 +46,7 @@
 #define GCONF_DBUS_DATABASE_GET_ALL_ENTRIES "AllEntries"
 #define GCONF_DBUS_DATABASE_GET_ALL_DIRS    "AllDirs"
 #define GCONF_DBUS_DATABASE_SET_SCHEMA      "SetSchema"
+#define GCONF_DBUS_DATABASE_SUGGEST_SYNC    "SuggestSync"
 
 #define GCONF_DBUS_DATABASE_ADD_NOTIFY      "AddNotify"
 #define GCONF_DBUS_DATABASE_REMOVE_NOTIFY   "RemoveNotify"

Modified: projects/haf/trunk/gconf2/gconf/gconf-dbus.c
===================================================================
--- projects/haf/trunk/gconf2/gconf/gconf-dbus.c	2007-06-27 13:01:37 UTC (rev 12510)
+++ projects/haf/trunk/gconf2/gconf/gconf-dbus.c	2007-06-27 13:06:12 UTC (rev 12511)
@@ -1957,6 +1957,11 @@
 void 
 gconf_engine_suggest_sync(GConfEngine* conf, GError** err)
 {
+  const gchar *db;
+  DBusMessage *message;
+  DBusMessage *reply;
+  DBusError error;
+  
   g_return_if_fail(conf != NULL);
   g_return_if_fail(err == NULL || *err == NULL);
 
@@ -1983,7 +1988,25 @@
       return;
     }
 
-  /* Do nothing for non-local case. */
+  g_assert(!gconf_engine_is_local(conf));
+
+  db = gconf_engine_get_database (conf, TRUE, err);
+
+  if (db == NULL)
+    {
+      g_return_if_fail (err == NULL || *err != NULL);
+    }
+  
+  message = dbus_message_new_method_call (GCONF_DBUS_SERVICE,
+					  db,
+					  GCONF_DBUS_DATABASE_INTERFACE,
+					  GCONF_DBUS_DATABASE_SUGGEST_SYNC);
+
+  dbus_error_init (&error);
+  reply = dbus_connection_send_with_reply_and_block (global_conn, message, -1, &error);
+  dbus_message_unref (message);
+
+  gconf_handle_dbus_exception (reply, &error, err);
 }
 
 void 


More information about the maemo-commits mailing list