[evolution-data-server/treitter-client-gdbus] Port the EDataCal D-Bus methods 'close' and 'remove' to gdbus.



commit 55b707c41db41c7a30aea70cca1e1366e66e7223
Author: Travis Reitter <treitter gmail com>
Date:   Wed Dec 16 21:48:02 2009 -0800

    Port the EDataCal D-Bus methods 'close' and 'remove' to gdbus.

 calendar/libecal/e-cal.c                     |    7 +----
 calendar/libecal/e-data-cal-gdbus-bindings.h |   28 ++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 5 deletions(-)
---
diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c
index 00365bf..33939bf 100644
--- a/calendar/libecal/e-cal.c
+++ b/calendar/libecal/e-cal.c
@@ -428,7 +428,6 @@ e_cal_dispose (GObject *object)
 		GError *error = NULL;
 
 		LOCK_CONN ();
-		org_gnome_evolution_dataserver_calendar_Cal_close (priv->proxy, &error);
 		g_object_unref (priv->proxy);
 		priv->proxy = NULL;
 		UNLOCK_CONN ();
@@ -442,9 +441,7 @@ e_cal_dispose (GObject *object)
 		g_object_weak_unref (G_OBJECT (priv->gdbus_proxy), proxy_destroyed, ecal);
 
 		LOCK_CONN ();
-		/* FIXME: uncomment this
 		e_data_cal_gdbus_close_sync (priv->gdbus_proxy, NULL);
-		*/
 		g_object_unref (priv->gdbus_proxy);
 		priv->gdbus_proxy = NULL;
 		UNLOCK_CONN ();
@@ -1373,10 +1370,10 @@ e_cal_remove (ECal *ecal, GError **error)
 
 	e_return_error_if_fail (E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
 	priv = ecal->priv;
-	e_return_error_if_fail (priv->proxy, E_CALENDAR_STATUS_REPOSITORY_OFFLINE);
+	e_return_error_if_fail (priv->gdbus_proxy, E_CALENDAR_STATUS_REPOSITORY_OFFLINE);
 
 	LOCK_CONN ();
-	if (!org_gnome_evolution_dataserver_calendar_Cal_remove (priv->proxy, error)) {
+	if (!e_data_cal_gdbus_remove_sync (priv->gdbus_proxy, error)) {
 		UNLOCK_CONN ();
 		E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_CORBA_EXCEPTION, error);
 	}
diff --git a/calendar/libecal/e-data-cal-gdbus-bindings.h b/calendar/libecal/e-data-cal-gdbus-bindings.h
index d2b8163..eee9f92 100644
--- a/calendar/libecal/e-data-cal-gdbus-bindings.h
+++ b/calendar/libecal/e-data-cal-gdbus-bindings.h
@@ -44,6 +44,20 @@ e_data_cal_gdbus_is_read_only_sync (GDBusProxy  *proxy,
 }
 
 static gboolean
+e_data_cal_gdbus_close_sync (GDBusProxy  *proxy,
+                             GError     **error)
+{
+        GVariant *parameters;
+        GVariant *retvals;
+
+        parameters = g_variant_new ("()");
+        retvals = g_dbus_proxy_invoke_method_sync (proxy, "close", parameters,
+                                                        -1, NULL, error);
+
+        return demarshal_retvals__VOID (retvals);
+}
+
+static gboolean
 e_data_cal_gdbus_open_sync (GDBusProxy      *proxy,
                             const gboolean   IN_only_if_exists,
                             const char      *IN_username,
@@ -102,4 +116,18 @@ e_data_cal_gdbus_open (GDBusProxy      *proxy,
 	return TRUE;
 }
 
+static gboolean
+e_data_cal_gdbus_remove_sync (GDBusProxy  *proxy,
+                              GError     **error)
+{
+        GVariant *parameters;
+        GVariant *retvals;
+
+        parameters = g_variant_new ("()");
+        retvals = g_dbus_proxy_invoke_method_sync (proxy, "remove", parameters,
+                                                        -1, NULL, error);
+
+        return demarshal_retvals__VOID (retvals);
+}
+
 G_END_DECLS



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