[evolution-data-server] Bug 721712 - Writeable calendars can report as read-only after open
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug 721712 - Writeable calendars can report as read-only after open
- Date: Tue, 1 Jul 2014 08:37:12 +0000 (UTC)
commit 033215f4ae567299a1aabcb4e1fbd13d10c3bfee
Author: Milan Crha <mcrha redhat com>
Date: Tue Jul 1 10:35:44 2014 +0200
Bug 721712 - Writeable calendars can report as read-only after open
addressbook/libebook/e-book-client.c | 148 ++++++++++++++++----
addressbook/libedata-book/e-data-book.c | 62 ++++++++-
calendar/libecal/e-cal-client.c | 146 ++++++++++++++++---
calendar/libedata-cal/e-data-cal.c | 62 ++++++++-
configure.ac | 8 +-
.../org.gnome.evolution.dataserver.AddressBook.xml | 4 +-
.../org.gnome.evolution.dataserver.Calendar.xml | 4 +-
7 files changed, 378 insertions(+), 56 deletions(-)
---
diff --git a/addressbook/libebook/e-book-client.c b/addressbook/libebook/e-book-client.c
index c962284..168a764 100644
--- a/addressbook/libebook/e-book-client.c
+++ b/addressbook/libebook/e-book-client.c
@@ -524,67 +524,64 @@ book_client_dbus_proxy_error_cb (EDBusAddressBook *dbus_proxy,
}
static void
-book_client_dbus_proxy_notify_cb (EDBusAddressBook *dbus_proxy,
- GParamSpec *pspec,
- GWeakRef *client_weak_ref)
+book_client_dbus_proxy_property_changed (EClient *client,
+ const gchar *property_name,
+ const GValue *value)
{
- EClient *client;
const gchar *backend_prop_name = NULL;
- client = g_weak_ref_get (client_weak_ref);
- if (client == NULL)
- return;
+ g_return_if_fail (E_IS_BOOK_CLIENT (client));
+ g_return_if_fail (property_name != NULL);
- if (g_str_equal (pspec->name, "cache-dir")) {
+ if (g_str_equal (property_name, "cache-dir")) {
backend_prop_name = CLIENT_BACKEND_PROPERTY_CACHE_DIR;
}
- if (g_str_equal (pspec->name, "capabilities")) {
+ if (g_str_equal (property_name, "capabilities")) {
gchar **strv;
gchar *csv = NULL;
backend_prop_name = CLIENT_BACKEND_PROPERTY_CAPABILITIES;
- strv = e_dbus_address_book_dup_capabilities (dbus_proxy);
+ strv = g_value_get_boxed (value);
if (strv != NULL) {
csv = g_strjoinv (",", strv);
- g_strfreev (strv);
}
e_client_set_capabilities (client, csv);
g_free (csv);
}
- if (g_str_equal (pspec->name, "online")) {
+ if (g_str_equal (property_name, "online")) {
gboolean online;
backend_prop_name = CLIENT_BACKEND_PROPERTY_ONLINE;
- online = e_dbus_address_book_get_online (dbus_proxy);
+ online = g_value_get_boolean (value);
e_client_set_online (client, online);
}
- if (g_str_equal (pspec->name, "required-fields")) {
+ if (g_str_equal (property_name, "required-fields")) {
backend_prop_name = BOOK_BACKEND_PROPERTY_REQUIRED_FIELDS;
}
- if (g_str_equal (pspec->name, "revision")) {
+ if (g_str_equal (property_name, "revision")) {
backend_prop_name = CLIENT_BACKEND_PROPERTY_REVISION;
}
- if (g_str_equal (pspec->name, "supported-fields")) {
+ if (g_str_equal (property_name, "supported-fields")) {
backend_prop_name = BOOK_BACKEND_PROPERTY_SUPPORTED_FIELDS;
}
- if (g_str_equal (pspec->name, "writable")) {
+ if (g_str_equal (property_name, "writable")) {
gboolean writable;
backend_prop_name = CLIENT_BACKEND_PROPERTY_READONLY;
- writable = e_dbus_address_book_get_writable (dbus_proxy);
+ writable = g_value_get_boolean (value);
e_client_set_readonly (client, !writable);
}
- if (g_str_equal (pspec->name, "locale")) {
+ if (g_str_equal (property_name, "locale")) {
backend_prop_name = "locale";
}
@@ -601,8 +598,7 @@ book_client_dbus_proxy_notify_cb (EDBusAddressBook *dbus_proxy,
* the value directly on the SignalClosure
*/
if (g_str_equal (backend_prop_name, "locale"))
- signal_closure->property_value =
- e_dbus_address_book_dup_locale (dbus_proxy);
+ signal_closure->property_value = g_value_dup_string (value);
main_context = e_client_ref_main_context (client);
@@ -617,7 +613,26 @@ book_client_dbus_proxy_notify_cb (EDBusAddressBook *dbus_proxy,
g_main_context_unref (main_context);
}
+}
+
+static void
+book_client_dbus_proxy_notify_cb (EDBusAddressBook *dbus_proxy,
+ GParamSpec *pspec,
+ GWeakRef *client_weak_ref)
+{
+ EClient *client;
+ GValue value = G_VALUE_INIT;
+
+ client = g_weak_ref_get (client_weak_ref);
+ if (client == NULL)
+ return;
+ g_value_init (&value, pspec->value_type);
+ g_object_get_property (G_OBJECT (dbus_proxy), pspec->name, &value);
+
+ book_client_dbus_proxy_property_changed (client, pspec->name, &value);
+
+ g_value_unset (&value);
g_object_unref (client);
}
@@ -711,6 +726,75 @@ book_client_finalize (GObject *object)
G_OBJECT_CLASS (e_book_client_parent_class)->finalize (object);
}
+static void
+book_client_process_properties (EBookClient *book_client,
+ gchar * const *properties)
+{
+ GObject *dbus_proxy;
+ GObjectClass *object_class;
+ gint ii;
+
+ g_return_if_fail (E_IS_BOOK_CLIENT (book_client));
+
+ dbus_proxy = G_OBJECT (book_client->priv->dbus_proxy);
+ g_return_if_fail (G_IS_OBJECT (dbus_proxy));
+
+ if (!properties)
+ return;
+
+ object_class = G_OBJECT_GET_CLASS (dbus_proxy);
+
+ for (ii = 0; properties[ii]; ii++) {
+ if (!(ii & 1) && properties[ii + 1]) {
+ GParamSpec *param;
+ GVariant *stored = NULL, *expected = NULL;
+
+ param = g_object_class_find_property (object_class, properties[ii]);
+ if (param) {
+ GValue value = G_VALUE_INIT;
+
+ g_value_init (&value, param->value_type);
+ g_object_get_property (dbus_proxy, param->name, &value);
+
+ #define WORKOUT(gvl, gvr) \
+ if (g_type_is_a (param->value_type, G_TYPE_ ## gvl)) { \
+ stored = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE_
## gvr); \
+ expected = g_variant_parse (G_VARIANT_TYPE_ ## gvr,
properties[ii + 1], NULL, NULL, NULL); \
+ }
+
+ WORKOUT (BOOLEAN, BOOLEAN);
+ WORKOUT (STRING, STRING);
+ WORKOUT (STRV, STRING_ARRAY);
+ WORKOUT (UCHAR, BYTE);
+ WORKOUT (INT, INT32);
+ WORKOUT (UINT, UINT32);
+ WORKOUT (INT64, INT64);
+ WORKOUT (UINT64, UINT64);
+ WORKOUT (DOUBLE, DOUBLE);
+
+ #undef WORKOUT
+
+ g_value_unset (&value);
+ }
+
+ if (stored && expected && !g_variant_equal (stored, expected)) {
+ GValue value = G_VALUE_INIT;
+
+ g_dbus_gvariant_to_gvalue (expected, &value);
+
+ book_client_dbus_proxy_property_changed (E_CLIENT (book_client), param->name,
&value);
+
+ g_value_unset (&value);
+ }
+
+ if (stored)
+ g_variant_unref (stored);
+ if (expected)
+ g_variant_unref (expected);
+ }
+ }
+}
+
static GDBusProxy *
book_client_get_dbus_proxy (EClient *client)
{
@@ -831,6 +915,7 @@ book_client_open_sync (EClient *client,
GError **error)
{
EBookClient *book_client;
+ gchar **properties = NULL;
GError *local_error = NULL;
g_return_val_if_fail (E_IS_BOOK_CLIENT (client), FALSE);
@@ -838,7 +923,10 @@ book_client_open_sync (EClient *client,
book_client = E_BOOK_CLIENT (client);
e_dbus_address_book_call_open_sync (
- book_client->priv->dbus_proxy, cancellable, &local_error);
+ book_client->priv->dbus_proxy, &properties, cancellable, &local_error);
+
+ book_client_process_properties (book_client, properties);
+ g_strfreev (properties);
if (local_error != NULL) {
g_dbus_error_strip_remote_error (local_error);
@@ -1195,9 +1283,15 @@ e_book_client_connect_sync (ESource *source,
g_initable_init (G_INITABLE (client), cancellable, &local_error);
- if (local_error == NULL)
+ if (local_error == NULL) {
+ gchar **properties = NULL;
+
e_dbus_address_book_call_open_sync (
- client->priv->dbus_proxy, cancellable, &local_error);
+ client->priv->dbus_proxy, &properties, cancellable, &local_error);
+
+ book_client_process_properties (client, properties);
+ g_strfreev (properties);
+ }
if (local_error != NULL) {
g_dbus_error_strip_remote_error (local_error);
@@ -1219,12 +1313,15 @@ book_client_connect_open_cb (GObject *source_object,
gpointer user_data)
{
GSimpleAsyncResult *simple;
+ gchar **properties = NULL;
GError *local_error = NULL;
simple = G_SIMPLE_ASYNC_RESULT (user_data);
e_dbus_address_book_call_open_finish (
- E_DBUS_ADDRESS_BOOK (source_object), result, &local_error);
+ E_DBUS_ADDRESS_BOOK (source_object), &properties, result, &local_error);
+
+ book_client_process_properties (E_BOOK_CLIENT (g_async_result_get_source_object (G_ASYNC_RESULT
(simple))), properties);
if (local_error != NULL) {
g_dbus_error_strip_remote_error (local_error);
@@ -1234,6 +1331,7 @@ book_client_connect_open_cb (GObject *source_object,
g_simple_async_result_complete (simple);
g_object_unref (simple);
+ g_strfreev (properties);
}
/* Helper for e_book_client_connect() */
diff --git a/addressbook/libedata-book/e-data-book.c b/addressbook/libedata-book/e-data-book.c
index 4c8e986..bc4af6d 100644
--- a/addressbook/libedata-book/e-data-book.c
+++ b/addressbook/libedata-book/e-data-book.c
@@ -557,9 +557,69 @@ data_book_complete_open_cb (GObject *source_object,
E_BOOK_BACKEND (source_object), result, &error);
if (error == NULL) {
+ GPtrArray *properties_array;
+ GParamSpec **properties;
+ guint ii, n_properties = 0;
+
+ properties_array = g_ptr_array_new_with_free_func (g_free);
+ properties = g_object_class_list_properties (G_OBJECT_GET_CLASS
(async_context->dbus_interface), &n_properties);
+
+ for (ii = 0; ii < n_properties; ii++) {
+ gboolean can_process =
+ g_type_is_a (properties[ii]->value_type, G_TYPE_BOOLEAN) ||
+ g_type_is_a (properties[ii]->value_type, G_TYPE_STRING) ||
+ g_type_is_a (properties[ii]->value_type, G_TYPE_STRV) ||
+ g_type_is_a (properties[ii]->value_type, G_TYPE_UCHAR) ||
+ g_type_is_a (properties[ii]->value_type, G_TYPE_INT) ||
+ g_type_is_a (properties[ii]->value_type, G_TYPE_UINT) ||
+ g_type_is_a (properties[ii]->value_type, G_TYPE_INT64) ||
+ g_type_is_a (properties[ii]->value_type, G_TYPE_UINT64) ||
+ g_type_is_a (properties[ii]->value_type, G_TYPE_DOUBLE);
+
+ if (can_process) {
+ GValue value = G_VALUE_INIT;
+ GVariant *stored = NULL;
+
+ g_value_init (&value, properties[ii]->value_type);
+ g_object_get_property ((GObject *) async_context->dbus_interface,
properties[ii]->name, &value);
+
+ #define WORKOUT(gvl, gvr) \
+ if (g_type_is_a (properties[ii]->value_type, G_TYPE_ ## gvl)) \
+ stored = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE_
## gvr);
+
+ WORKOUT (BOOLEAN, BOOLEAN);
+ WORKOUT (STRING, STRING);
+ WORKOUT (STRV, STRING_ARRAY);
+ WORKOUT (UCHAR, BYTE);
+ WORKOUT (INT, INT32);
+ WORKOUT (UINT, UINT32);
+ WORKOUT (INT64, INT64);
+ WORKOUT (UINT64, UINT64);
+ WORKOUT (DOUBLE, DOUBLE);
+
+ #undef WORKOUT
+
+ g_value_unset (&value);
+
+ if (stored) {
+ g_ptr_array_add (properties_array, g_strdup (properties[ii]->name));
+ g_ptr_array_add (properties_array, g_variant_print (stored, TRUE));
+
+ g_variant_unref (stored);
+ }
+ }
+ }
+
+ g_free (properties);
+
+ g_ptr_array_add (properties_array, NULL);
+
e_dbus_address_book_complete_open (
async_context->dbus_interface,
- async_context->invocation);
+ async_context->invocation,
+ (const gchar * const *) properties_array->pdata);
+
+ g_ptr_array_free (properties_array, TRUE);
} else {
data_book_convert_to_client_error (error);
g_dbus_method_invocation_take_error (
diff --git a/calendar/libecal/e-cal-client.c b/calendar/libecal/e-cal-client.c
index bb0d921..1a3d648 100644
--- a/calendar/libecal/e-cal-client.c
+++ b/calendar/libecal/e-cal-client.c
@@ -574,67 +574,64 @@ cal_client_dbus_proxy_error_cb (EDBusCalendar *dbus_proxy,
}
static void
-cal_client_dbus_proxy_notify_cb (EDBusCalendar *dbus_proxy,
- GParamSpec *pspec,
- GWeakRef *client_weak_ref)
+cal_client_dbus_proxy_property_changed (EClient *client,
+ const gchar *property_name,
+ const GValue *value)
{
- EClient *client;
const gchar *backend_prop_name = NULL;
- client = g_weak_ref_get (client_weak_ref);
- if (client == NULL)
- return;
+ g_return_if_fail (E_IS_CAL_CLIENT (client));
+ g_return_if_fail (property_name != NULL);
- if (g_str_equal (pspec->name, "alarm-email-address")) {
+ if (g_str_equal (property_name, "alarm-email-address")) {
backend_prop_name = CAL_BACKEND_PROPERTY_ALARM_EMAIL_ADDRESS;
}
- if (g_str_equal (pspec->name, "cache-dir")) {
+ if (g_str_equal (property_name, "cache-dir")) {
backend_prop_name = CLIENT_BACKEND_PROPERTY_CACHE_DIR;
}
- if (g_str_equal (pspec->name, "cal-email-address")) {
+ if (g_str_equal (property_name, "cal-email-address")) {
backend_prop_name = CAL_BACKEND_PROPERTY_CAL_EMAIL_ADDRESS;
}
- if (g_str_equal (pspec->name, "capabilities")) {
+ if (g_str_equal (property_name, "capabilities")) {
gchar **strv;
gchar *csv = NULL;
backend_prop_name = CLIENT_BACKEND_PROPERTY_CAPABILITIES;
- strv = e_dbus_calendar_dup_capabilities (dbus_proxy);
+ strv = g_value_get_boxed (value);
if (strv != NULL) {
csv = g_strjoinv (",", strv);
- g_strfreev (strv);
}
e_client_set_capabilities (client, csv);
g_free (csv);
}
- if (g_str_equal (pspec->name, "default-object")) {
+ if (g_str_equal (property_name, "default-object")) {
backend_prop_name = CAL_BACKEND_PROPERTY_DEFAULT_OBJECT;
}
- if (g_str_equal (pspec->name, "online")) {
+ if (g_str_equal (property_name, "online")) {
gboolean online;
backend_prop_name = CLIENT_BACKEND_PROPERTY_ONLINE;
- online = e_dbus_calendar_get_online (dbus_proxy);
+ online = g_value_get_boolean (value);
e_client_set_online (client, online);
}
- if (g_str_equal (pspec->name, "revision")) {
+ if (g_str_equal (property_name, "revision")) {
backend_prop_name = CLIENT_BACKEND_PROPERTY_REVISION;
}
- if (g_str_equal (pspec->name, "writable")) {
+ if (g_str_equal (property_name, "writable")) {
gboolean writable;
backend_prop_name = CLIENT_BACKEND_PROPERTY_READONLY;
- writable = e_dbus_calendar_get_writable (dbus_proxy);
+ writable = g_value_get_boolean (value);
e_client_set_readonly (client, !writable);
}
@@ -661,6 +658,26 @@ cal_client_dbus_proxy_notify_cb (EDBusCalendar *dbus_proxy,
g_main_context_unref (main_context);
}
+}
+
+static void
+cal_client_dbus_proxy_notify_cb (EDBusCalendar *dbus_proxy,
+ GParamSpec *pspec,
+ GWeakRef *client_weak_ref)
+{
+ EClient *client;
+ GValue value = G_VALUE_INIT;
+
+ client = g_weak_ref_get (client_weak_ref);
+ if (client == NULL)
+ return;
+
+ g_value_init (&value, pspec->value_type);
+ g_object_get_property (G_OBJECT (dbus_proxy), pspec->name, &value);
+
+ cal_client_dbus_proxy_property_changed (client, pspec->name, &value);
+
+ g_value_unset (&value);
g_object_unref (client);
}
@@ -845,6 +862,75 @@ cal_client_finalize (GObject *object)
G_OBJECT_CLASS (e_cal_client_parent_class)->finalize (object);
}
+static void
+cal_client_process_properties (ECalClient *cal_client,
+ gchar * const *properties)
+{
+ GObject *dbus_proxy;
+ GObjectClass *object_class;
+ gint ii;
+
+ g_return_if_fail (E_IS_CAL_CLIENT (cal_client));
+
+ dbus_proxy = G_OBJECT (cal_client->priv->dbus_proxy);
+ g_return_if_fail (G_IS_OBJECT (dbus_proxy));
+
+ if (!properties)
+ return;
+
+ object_class = G_OBJECT_GET_CLASS (dbus_proxy);
+
+ for (ii = 0; properties[ii]; ii++) {
+ if (!(ii & 1) && properties[ii + 1]) {
+ GParamSpec *param;
+ GVariant *stored = NULL, *expected = NULL;
+
+ param = g_object_class_find_property (object_class, properties[ii]);
+ if (param) {
+ GValue value = G_VALUE_INIT;
+
+ g_value_init (&value, param->value_type);
+ g_object_get_property (dbus_proxy, param->name, &value);
+
+ #define WORKOUT(gvl, gvr) \
+ if (g_type_is_a (param->value_type, G_TYPE_ ## gvl)) { \
+ stored = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE_
## gvr); \
+ expected = g_variant_parse (G_VARIANT_TYPE_ ## gvr,
properties[ii + 1], NULL, NULL, NULL); \
+ }
+
+ WORKOUT (BOOLEAN, BOOLEAN);
+ WORKOUT (STRING, STRING);
+ WORKOUT (STRV, STRING_ARRAY);
+ WORKOUT (UCHAR, BYTE);
+ WORKOUT (INT, INT32);
+ WORKOUT (UINT, UINT32);
+ WORKOUT (INT64, INT64);
+ WORKOUT (UINT64, UINT64);
+ WORKOUT (DOUBLE, DOUBLE);
+
+ #undef WORKOUT
+
+ g_value_unset (&value);
+ }
+
+ if (stored && expected && !g_variant_equal (stored, expected)) {
+ GValue value = G_VALUE_INIT;
+
+ g_dbus_gvariant_to_gvalue (expected, &value);
+
+ cal_client_dbus_proxy_property_changed (E_CLIENT (cal_client), param->name,
&value);
+
+ g_value_unset (&value);
+ }
+
+ if (stored)
+ g_variant_unref (stored);
+ if (expected)
+ g_variant_unref (expected);
+ }
+ }
+}
+
static GDBusProxy *
cal_client_get_dbus_proxy (EClient *client)
{
@@ -960,6 +1046,7 @@ cal_client_open_sync (EClient *client,
GError **error)
{
ECalClient *cal_client;
+ gchar **properties = NULL;
GError *local_error = NULL;
g_return_val_if_fail (E_IS_CAL_CLIENT (client), FALSE);
@@ -967,7 +1054,10 @@ cal_client_open_sync (EClient *client,
cal_client = E_CAL_CLIENT (client);
e_dbus_calendar_call_open_sync (
- cal_client->priv->dbus_proxy, cancellable, &local_error);
+ cal_client->priv->dbus_proxy, &properties, cancellable, &local_error);
+
+ cal_client_process_properties (cal_client, properties);
+ g_strfreev (properties);
if (local_error != NULL) {
g_dbus_error_strip_remote_error (local_error);
@@ -1518,9 +1608,15 @@ e_cal_client_connect_sync (ESource *source,
g_initable_init (G_INITABLE (client), cancellable, &local_error);
- if (local_error == NULL)
+ if (local_error == NULL) {
+ gchar **properties = NULL;
+
e_dbus_calendar_call_open_sync (
- client->priv->dbus_proxy, cancellable, &local_error);
+ client->priv->dbus_proxy, &properties, cancellable, &local_error);
+
+ cal_client_process_properties (client, properties);
+ g_strfreev (properties);
+ }
if (local_error != NULL) {
g_dbus_error_strip_remote_error (local_error);
@@ -1542,12 +1638,15 @@ cal_client_connect_open_cb (GObject *source_object,
gpointer user_data)
{
GSimpleAsyncResult *simple;
+ gchar **properties = NULL;
GError *local_error = NULL;
simple = G_SIMPLE_ASYNC_RESULT (user_data);
e_dbus_calendar_call_open_finish (
- E_DBUS_CALENDAR (source_object), result, &local_error);
+ E_DBUS_CALENDAR (source_object), &properties, result, &local_error);
+
+ cal_client_process_properties (E_CAL_CLIENT (g_async_result_get_source_object (G_ASYNC_RESULT
(simple))), properties);
if (local_error != NULL) {
g_dbus_error_strip_remote_error (local_error);
@@ -1557,6 +1656,7 @@ cal_client_connect_open_cb (GObject *source_object,
g_simple_async_result_complete (simple);
g_object_unref (simple);
+ g_strfreev (properties);
}
/* Helper for e_cal_client_connect() */
diff --git a/calendar/libedata-cal/e-data-cal.c b/calendar/libedata-cal/e-data-cal.c
index 3d34c3c..e06acd2 100644
--- a/calendar/libedata-cal/e-data-cal.c
+++ b/calendar/libedata-cal/e-data-cal.c
@@ -509,9 +509,69 @@ data_cal_complete_open_cb (GObject *source_object,
E_CAL_BACKEND (source_object), result, &error);
if (error == NULL) {
+ GPtrArray *properties_array;
+ GParamSpec **properties;
+ guint ii, n_properties = 0;
+
+ properties_array = g_ptr_array_new_with_free_func (g_free);
+ properties = g_object_class_list_properties (G_OBJECT_GET_CLASS
(async_context->dbus_interface), &n_properties);
+
+ for (ii = 0; ii < n_properties; ii++) {
+ gboolean can_process =
+ g_type_is_a (properties[ii]->value_type, G_TYPE_BOOLEAN) ||
+ g_type_is_a (properties[ii]->value_type, G_TYPE_STRING) ||
+ g_type_is_a (properties[ii]->value_type, G_TYPE_STRV) ||
+ g_type_is_a (properties[ii]->value_type, G_TYPE_UCHAR) ||
+ g_type_is_a (properties[ii]->value_type, G_TYPE_INT) ||
+ g_type_is_a (properties[ii]->value_type, G_TYPE_UINT) ||
+ g_type_is_a (properties[ii]->value_type, G_TYPE_INT64) ||
+ g_type_is_a (properties[ii]->value_type, G_TYPE_UINT64) ||
+ g_type_is_a (properties[ii]->value_type, G_TYPE_DOUBLE);
+
+ if (can_process) {
+ GValue value = G_VALUE_INIT;
+ GVariant *stored = NULL;
+
+ g_value_init (&value, properties[ii]->value_type);
+ g_object_get_property ((GObject *) async_context->dbus_interface,
properties[ii]->name, &value);
+
+ #define WORKOUT(gvl, gvr) \
+ if (g_type_is_a (properties[ii]->value_type, G_TYPE_ ## gvl)) \
+ stored = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE_
## gvr);
+
+ WORKOUT (BOOLEAN, BOOLEAN);
+ WORKOUT (STRING, STRING);
+ WORKOUT (STRV, STRING_ARRAY);
+ WORKOUT (UCHAR, BYTE);
+ WORKOUT (INT, INT32);
+ WORKOUT (UINT, UINT32);
+ WORKOUT (INT64, INT64);
+ WORKOUT (UINT64, UINT64);
+ WORKOUT (DOUBLE, DOUBLE);
+
+ #undef WORKOUT
+
+ g_value_unset (&value);
+
+ if (stored) {
+ g_ptr_array_add (properties_array, g_strdup (properties[ii]->name));
+ g_ptr_array_add (properties_array, g_variant_print (stored, TRUE));
+
+ g_variant_unref (stored);
+ }
+ }
+ }
+
+ g_free (properties);
+
+ g_ptr_array_add (properties_array, NULL);
+
e_dbus_calendar_complete_open (
async_context->dbus_interface,
- async_context->invocation);
+ async_context->invocation,
+ (const gchar * const *) properties_array->pdata);
+
+ g_ptr_array_free (properties_array, TRUE);
} else {
data_cal_convert_to_client_error (error);
g_dbus_method_invocation_take_error (
diff --git a/configure.ac b/configure.ac
index d04f526..0f7205e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -73,8 +73,8 @@ GLIB_GSETTINGS
dnl ******************************
dnl D-Bus versioning
dnl ******************************
-ADDRESS_BOOK_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.AddressBook6"
-CALENDAR_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.Calendar4"
+ADDRESS_BOOK_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.AddressBook7"
+CALENDAR_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.Calendar5"
SOURCES_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.Sources3"
USER_PROMPTER_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.UserPrompter0"
@@ -114,11 +114,11 @@ LIBECAL_CURRENT=16
LIBECAL_REVISION=0
LIBECAL_AGE=0
-LIBEDATACAL_CURRENT=24
+LIBEDATACAL_CURRENT=25
LIBEDATACAL_REVISION=0
LIBEDATACAL_AGE=0
-LIBEDATABOOK_CURRENT=22
+LIBEDATABOOK_CURRENT=23
LIBEDATABOOK_REVISION=0
LIBEDATABOOK_AGE=0
diff --git a/private/org.gnome.evolution.dataserver.AddressBook.xml
b/private/org.gnome.evolution.dataserver.AddressBook.xml
index 60a15d1..f8ff126 100644
--- a/private/org.gnome.evolution.dataserver.AddressBook.xml
+++ b/private/org.gnome.evolution.dataserver.AddressBook.xml
@@ -28,7 +28,9 @@
<arg name="error_message" type="s"/>
</signal>
- <method name="Open"/>
+ <method name="Open">
+ <arg name="properties" direction="out" type="as"/>
+ </method>
<method name="Close"/>
diff --git a/private/org.gnome.evolution.dataserver.Calendar.xml
b/private/org.gnome.evolution.dataserver.Calendar.xml
index 386e81d..8d76194 100644
--- a/private/org.gnome.evolution.dataserver.Calendar.xml
+++ b/private/org.gnome.evolution.dataserver.Calendar.xml
@@ -32,7 +32,9 @@
<arg name="ics_objects" type="as"/>
</signal>
- <method name="Open"/>
+ <method name="Open">
+ <arg name="properties" direction="out" type="as"/>
+ </method>
<method name="Close"/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]