[evolution-data-server/openismus-work-master: 32/37] EBookBackend added new ->set_locale() API to notify backends that the locale has changed.



commit f33d308f93dec136647e40bd1da8ce6c9ed76d77
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Fri May 17 20:03:45 2013 +0900

    EBookBackend added new ->set_locale() API to notify backends that the locale has changed.

 addressbook/libedata-book/e-book-backend.c |   25 +++++++++++++++++++++++++
 addressbook/libedata-book/e-book-backend.h |    6 ++++++
 2 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend.c b/addressbook/libedata-book/e-book-backend.c
index fe03891..b501dd9 100644
--- a/addressbook/libedata-book/e-book-backend.c
+++ b/addressbook/libedata-book/e-book-backend.c
@@ -3073,6 +3073,31 @@ e_book_backend_sync (EBookBackend *backend)
 }
 
 /**
+ * e_book_backend_set_locale:
+ * @backend: an #EBookbackend
+ * @locale: the new locale for the addressbook
+ *
+ * Notify the addressbook backend that the current locale has
+ * changed, this is important for backends which support
+ * ordered result lists which are locale sensitive.
+ *
+ * Since: 3.10
+ */
+void
+e_book_backend_set_locale (EBookBackend *backend,
+                          const gchar  *locale)
+{
+       g_return_if_fail (E_IS_BOOK_BACKEND (backend));
+
+       g_object_ref (backend);
+
+       if (E_BOOK_BACKEND_GET_CLASS (backend)->set_locale)
+               (* E_BOOK_BACKEND_GET_CLASS (backend)->set_locale) (backend, locale);
+
+       g_object_unref (backend);
+}
+
+/**
  * e_book_backend_notify_update:
  * @backend: an #EBookBackend
  * @contact: a new or modified contact
diff --git a/addressbook/libedata-book/e-book-backend.h b/addressbook/libedata-book/e-book-backend.h
index a4668d1..b182771 100644
--- a/addressbook/libedata-book/e-book-backend.h
+++ b/addressbook/libedata-book/e-book-backend.h
@@ -211,6 +211,9 @@ struct _EBookBackendClass {
 
        void            (*sync)                 (EBookBackend *backend);
 
+       void            (*set_locale)           (EBookBackend *backend,
+                                                const gchar  *locale);
+
        /* Signals */
        void            (*closed)               (EBookBackend *backend,
                                                 const gchar *sender);
@@ -378,6 +381,9 @@ void                e_book_backend_configure_direct (EBookBackend *backend,
 
 void           e_book_backend_sync             (EBookBackend *backend);
 
+void            e_book_backend_set_locale       (EBookBackend *backend,
+                                                const gchar  *locale);
+
 GSimpleAsyncResult *
                e_book_backend_prepare_for_completion
                                                (EBookBackend *backend,


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