[evolution-data-server/openismus-work: 38/52] EBookClient: If the client is a direct access client, then use a direct access EBookClientView as we
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/openismus-work: 38/52] EBookClient: If the client is a direct access client, then use a direct access EBookClientView as we
- Date: Thu, 22 Nov 2012 04:30:16 +0000 (UTC)
commit 4878254f8bae12adf77e1c7925970b7a4cb29b79
Author: Tristan Van Berkom <tristanvb openismus com>
Date: Fri Nov 16 19:00:14 2012 +0900
EBookClient: If the client is a direct access client, then use a direct access EBookClientView as well when creating one.
addressbook/libebook/e-book-client.c | 49 +++++++++++++++++++++++++++++++--
1 files changed, 46 insertions(+), 3 deletions(-)
---
diff --git a/addressbook/libebook/e-book-client.c b/addressbook/libebook/e-book-client.c
index ad8810a..2232046 100644
--- a/addressbook/libebook/e-book-client.c
+++ b/addressbook/libebook/e-book-client.c
@@ -2435,8 +2435,18 @@ e_book_client_get_view (EBookClient *client,
{
gchar *gdbus_sexp = NULL;
+ g_return_if_fail (E_IS_BOOK_CLIENT (client));
g_return_if_fail (sexp != NULL);
+ if (client->priv->direct_book) {
+ PropagateReadyData *data = propagate_ready_data_new (client, callback, user_data,
+ e_book_client_get_view, NULL);
+
+ e_data_book_get_view (client->priv->direct_book, sexp, cancellable,
+ propagate_direct_book_async_ready, data);
+ return;
+ }
+
e_client_proxy_call_string (
E_CLIENT (client), e_util_ensure_gdbus_string (sexp, &gdbus_sexp), cancellable, callback, user_data, e_book_client_get_view,
e_gdbus_book_call_get_view,
@@ -2510,14 +2520,31 @@ e_book_client_get_view_finish (EBookClient *client,
EBookClientView **view,
GError **error)
{
- gboolean res;
+ gboolean ret;
gchar *view_path = NULL;
g_return_val_if_fail (view != NULL, FALSE);
- res = e_client_proxy_call_finish_string (E_CLIENT (client), result, &view_path, error, e_book_client_get_view);
+ if (client->priv->direct_book) {
+ GAsyncResult *res = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (result));
+ EDataBookView *direct_view = NULL;
- return complete_get_view (client, res, view_path, view, error);
+ if (e_data_book_get_view_finish (client->priv->direct_book, res, &direct_view, error)) {
+
+ *view = _e_book_client_view_new_direct (client, direct_view);
+
+ /* Pass ownership to the EBookClientView */
+ g_object_unref (direct_view);
+
+ return TRUE;
+ }
+
+ return FALSE;
+ }
+
+ ret = e_client_proxy_call_finish_string (E_CLIENT (client), result, &view_path, error, e_book_client_get_view);
+
+ return complete_get_view (client, ret, view_path, view, error);
}
/**
@@ -2554,6 +2581,22 @@ e_book_client_get_view_sync (EBookClient *client,
g_return_val_if_fail (sexp != NULL, FALSE);
g_return_val_if_fail (view != NULL, FALSE);
+ if (client->priv->direct_book) {
+ EDataBookView *direct_view = NULL;
+
+ if (e_data_book_get_view_sync (client->priv->direct_book, sexp, &direct_view, cancellable, error)) {
+
+ *view = _e_book_client_view_new_direct (client, direct_view);
+
+ /* Pass ownership to the EBookClientView */
+ g_object_unref (direct_view);
+
+ return TRUE;
+ }
+
+ return FALSE;
+ }
+
if (!client->priv->gdbus_book) {
set_proxy_gone_error (error);
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]