[evolution-data-server/openismus-work] Fixed problems with e_gdbus_book_call_get_book_view() and e_gdbus_book_call_get_book_view_sync().



commit 93d7919c7ee84b64cc8e50c6469507429b85e939
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Sun Jun 12 16:35:32 2011 +0900

    Fixed problems with e_gdbus_book_call_get_book_view() and e_gdbus_book_call_get_book_view_sync().
    
    Problem was that passing 'NULL' as a value for a G_TYPE_STRV GVariant
    was causing assertions, passing a single NULL element in the case of
    and empty array fixes this problem.

 addressbook/libegdbus/e-gdbus-egdbusbook.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/addressbook/libegdbus/e-gdbus-egdbusbook.c b/addressbook/libegdbus/e-gdbus-egdbusbook.c
index 77f2222..d314431 100644
--- a/addressbook/libegdbus/e-gdbus-egdbusbook.c
+++ b/addressbook/libegdbus/e-gdbus-egdbusbook.c
@@ -2165,9 +2165,11 @@ void e_gdbus_book_call_get_book_view (
         gpointer user_data)
 {
   GVariant *_params;
-  _params = g_variant_new ("(s^a&su)",
+  gchar    *empty[1] = { NULL };
+
+  _params = g_variant_new ("(s^asu)",
                            in_query,
-			   in_requested_fields,
+			   (gchar **)in_requested_fields ? (gchar **)in_requested_fields : empty,
                            in_max_results);
   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
                      "getBookView",
@@ -2243,9 +2245,11 @@ gboolean e_gdbus_book_call_get_book_view_sync (
   gboolean _ret = FALSE;
   GVariant *_params;
   GVariant *_result;
-  _params = g_variant_new ("(s^a&su)",
+  gchar    *empty[1] = { NULL };
+
+  _params = g_variant_new ("(s^asu)",
                            in_query,
-			   in_requested_fields,
+			   (gchar **)in_requested_fields ? (gchar **)in_requested_fields : empty,
                            in_max_results);
   _result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
                                    "getBookView",
@@ -3689,14 +3693,18 @@ handle_method_call (GDBusConnection       *connection,
         EGdbusBook *object = E_GDBUS_BOOK (user_data);
         gboolean handled;
         const gchar *arg_query;
+	gchar **arg_req_fields;
         guint arg_max_results;
         g_variant_get (parameters,
-                       "(&su)",
+                       "(&s^a&su)",
                        &arg_query,
+		       &arg_req_fields,
                        &arg_max_results);
         g_signal_emit (object,
                        signals[method_id],
-                       0, invocation, arg_query, arg_max_results, &handled);
+                       0, invocation, arg_query, arg_req_fields, arg_max_results, &handled);
+
+	g_free (arg_req_fields);
         if (!handled)
           goto not_implemented;
       }



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