[evolution-data-server/openismus-work-3-8: 17/43] EBookBackend: e_book_backend_set_locale() now has GCancellable



commit 26d8eb3546ceeccba9cefd687d926db7dd90201e
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
    
    Conflicts:
    
        addressbook/libedata-book/e-book-backend.h

 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 db5a791..c73da34 100644
--- a/addressbook/libedata-book/e-book-backend.c
+++ b/addressbook/libedata-book/e-book-backend.c
@@ -1205,25 +1205,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 d8b8edb..db683b1 100644
--- a/addressbook/libedata-book/e-book-backend.h
+++ b/addressbook/libedata-book/e-book-backend.h
@@ -203,8 +203,10 @@ struct _EBookBackendClass {
                        (*get_direct_book)      (EBookBackend *backend);
        void            (*configure_direct)     (EBookBackend *backend,
                                                 const gchar *config);
-       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,
@@ -316,8 +318,10 @@ EDataBookDirect *
 void            e_book_backend_configure_direct (EBookBackend *backend, const gchar *config);
 
 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]