[evolution-data-server/openismus-work: 7/10] Handle org....BookView.setFlags api in EDataBookView.
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/openismus-work: 7/10] Handle org....BookView.setFlags api in EDataBookView.
- Date: Thu, 16 Jun 2011 22:35:22 +0000 (UTC)
commit 257972b7314ee57b45be498a317e17a03297b4c4
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Thu Jun 16 19:28:37 2011 +0900
Handle org....BookView.setFlags api in EDataBookView.
This handles the dbus api and just sets up the flags on
the private data. Currently the patch assumes that the
flags will be set before starting the view however it
would be good eventually to add a "flags" property to
the EDataBookView so that backends could watch it for
change notifications.
addressbook/libedata-book/e-data-book-view.c | 35 +++++++++++++++++++++++++-
addressbook/libedata-book/e-data-book-view.h | 3 +-
2 files changed, 36 insertions(+), 2 deletions(-)
---
diff --git a/addressbook/libedata-book/e-data-book-view.c b/addressbook/libedata-book/e-data-book-view.c
index dce561c..24e124f 100644
--- a/addressbook/libedata-book/e-data-book-view.c
+++ b/addressbook/libedata-book/e-data-book-view.c
@@ -26,6 +26,7 @@
#include <string.h>
#include <libebook/e-contact.h>
+#include <libebook/e-book-view.h>
#include "e-data-book-view.h"
#include "e-gdbus-egdbusbookview.h"
@@ -49,6 +50,7 @@ struct _EDataBookViewPrivate {
EBookBackendSExp *card_sexp;
gchar **requested_fields;
gint max_results;
+ EBookViewFlags flags;
gboolean running;
GMutex *pending_mutex;
@@ -59,7 +61,6 @@ struct _EDataBookViewPrivate {
GHashTable *ids;
guint idle_id;
-
guint flush_id;
};
@@ -558,6 +559,19 @@ impl_DataBookView_stop (EGdbusBookView *object, GDBusMethodInvocation *invocatio
}
static gboolean
+impl_DataBookView_setFlags (EGdbusBookView *object,
+ GDBusMethodInvocation *invocation,
+ EBookViewFlags flags,
+ EDataBookView *book_view)
+{
+ book_view->priv->flags = flags;
+
+ e_gdbus_book_view_complete_set_flags (object, invocation);
+
+ return TRUE;
+}
+
+static gboolean
impl_DataBookView_dispose (EGdbusBookView *object, GDBusMethodInvocation *invocation, EDataBookView *book_view)
{
e_gdbus_book_view_complete_dispose (object, invocation);
@@ -573,9 +587,12 @@ e_data_book_view_init (EDataBookView *book_view)
EDataBookViewPrivate *priv = E_DATA_BOOK_VIEW_GET_PRIVATE (book_view);
book_view->priv = priv;
+ priv->flags = E_BOOK_VIEW_DEFAULT_FLAGS;
+
priv->gdbus_object = e_gdbus_book_view_stub_new ();
g_signal_connect (priv->gdbus_object, "handle-start", G_CALLBACK (impl_DataBookView_start), book_view);
g_signal_connect (priv->gdbus_object, "handle-stop", G_CALLBACK (impl_DataBookView_stop), book_view);
+ g_signal_connect (priv->gdbus_object, "handle-set-flags", G_CALLBACK (impl_DataBookView_setFlags), book_view);
g_signal_connect (priv->gdbus_object, "handle-dispose", G_CALLBACK (impl_DataBookView_dispose), book_view);
priv->running = FALSE;
@@ -732,6 +749,22 @@ e_data_book_view_get_max_results (EDataBookView *book_view)
}
/**
+ * e_data_book_view_get_flags:
+ * @book_view: an #EDataBookView
+ *
+ * Gets the #EBookViewFlags that control the behaviour of @book_view.
+ *
+ * Returns: the flags for @book_view.
+ **/
+EBookViewFlags
+e_data_book_view_get_flags (EDataBookView *book_view)
+{
+ g_return_val_if_fail (E_IS_DATA_BOOK_VIEW (book_view), 0);
+
+ return book_view->priv->flags;
+}
+
+/**
* e_data_book_view_get_backend:
* @book_view: an #EDataBookView
*
diff --git a/addressbook/libedata-book/e-data-book-view.h b/addressbook/libedata-book/e-data-book-view.h
index 2e37c0a..954468a 100644
--- a/addressbook/libedata-book/e-data-book-view.h
+++ b/addressbook/libedata-book/e-data-book-view.h
@@ -28,6 +28,7 @@
#include <glib-object.h>
#include <gio/gio.h>
#include <libebook/e-contact.h>
+#include <libebook/e-book-view.h>
#include <libedata-book/e-data-book-types.h>
#include <libedata-book/e-book-backend.h>
#include <libedata-book/e-book-backend-sexp.h>
@@ -68,10 +69,10 @@ const gchar * e_data_book_view_get_card_query (EDataBookView
EBookBackendSExp* e_data_book_view_get_card_sexp (EDataBookView *book_view);
const gchar ** e_data_book_view_get_requested_fields (EDataBookView *book_view);
gint e_data_book_view_get_max_results (EDataBookView *book_view);
+EBookViewFlags e_data_book_view_get_flags (EDataBookView *book_view);
EBookBackend* e_data_book_view_get_backend (EDataBookView *book_view);
void e_data_book_view_notify_update (EDataBookView *book_view,
EContact *contact);
-
void e_data_book_view_notify_update_vcard (EDataBookView *book_view,
gchar *vcard);
void e_data_book_view_notify_update_prefiltered_vcard (EDataBookView *book_view,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]