[evolution-data-server/sqlite-refactor: 10/21] EBookBackend: e_book_backend_set_locale() now has GCancellable



commit 7f0d55cea3c14b1fb1385596b501724e228eebae
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Fri Nov 29 21:23:34 2013 +0900

    EBookBackend: e_book_backend_set_locale() now has GCancellable

 addressbook/libedata-book/e-book-backend.c |   19 ++++++++++++++-----
 addressbook/libedata-book/e-book-backend.h |   12 ++++++++----
 2 files changed, 22 insertions(+), 9 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend.c b/addressbook/libedata-book/e-book-backend.c
index ce5afc3..2e312c5 100644
--- a/addressbook/libedata-book/e-book-backend.c
+++ b/addressbook/libedata-book/e-book-backend.c
@@ -3288,25 +3288,34 @@ e_book_backend_sync (EBookBackend *backend)
  * e_book_backend_set_locale:
  * @backend: an #EBookbackend
  * @locale: the new locale for the addressbook
+ * @cancellable: optional #GCancellable object, or %NULL
+ * @error: return location for a #GError, or %NULL
  *
  * Notify the addressbook backend that the current locale has
  * changed, this is important for backends which support
  * ordered result lists which are locale sensitive.
  *
+ * Returns: %TRUE on success, %FALSE on failure
+ *
  * Since: 3.12
  */
-void
+gboolean
 e_book_backend_set_locale (EBookBackend *backend,
-                          const gchar  *locale)
+                          const gchar  *locale,
+                          GCancellable *cancellable,
+                          GError      **error)
 {
-       g_return_if_fail (E_IS_BOOK_BACKEND (backend));
+       g_return_val_if_fail (E_IS_BOOK_BACKEND (backend), FALSE);
 
        g_object_ref (backend);
 
        if (E_BOOK_BACKEND_GET_CLASS (backend)->set_locale)
-               (* E_BOOK_BACKEND_GET_CLASS (backend)->set_locale) (backend, locale);
-
+               return (* E_BOOK_BACKEND_GET_CLASS (backend)->set_locale) (backend, locale,
+                                                                          cancellable, error);
        g_object_unref (backend);
+
+       /* Backend does not support locales, just happily return */
+       return TRUE;
 }
 
 /**
diff --git a/addressbook/libedata-book/e-book-backend.h b/addressbook/libedata-book/e-book-backend.h
index 43594cb..d3230b0 100644
--- a/addressbook/libedata-book/e-book-backend.h
+++ b/addressbook/libedata-book/e-book-backend.h
@@ -218,8 +218,10 @@ struct _EBookBackendClass {
 
        void            (*sync)                 (EBookBackend *backend);
 
-       void            (*set_locale)           (EBookBackend *backend,
-                                                const gchar  *locale);
+       gboolean        (*set_locale)           (EBookBackend *backend,
+                                                const gchar  *locale,
+                                                GCancellable *cancellable,
+                                                GError **error);
        gchar          *(*dup_locale)           (EBookBackend *backend);
        EDataBookCursor *
                        (*create_cursor)        (EBookBackend *backend,
@@ -402,8 +404,10 @@ 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);
+gboolean        e_book_backend_set_locale       (EBookBackend *backend,
+                                                const gchar  *locale,
+                                                GCancellable *cancellable,
+                                                GError      **error);
 gchar          *e_book_backend_dup_locale       (EBookBackend *backend);
 
 EDataBookCursor *


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