[evolution-data-server/openismus-work] EBookBackendFile: Properly translate E_BOOK_SDB_ERROR_QUERY_INVALID errors



commit 3b14497ebd21c3fd7fcdddbcf65ab13d0db1fa9f
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Wed Feb 27 20:08:45 2013 +0900

    EBookBackendFile: Properly translate E_BOOK_SDB_ERROR_QUERY_INVALID errors

 addressbook/backends/file/e-book-backend-file.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/addressbook/backends/file/e-book-backend-file.c b/addressbook/backends/file/e-book-backend-file.c
index 6f581c2..4ba01a9 100644
--- a/addressbook/backends/file/e-book-backend-file.c
+++ b/addressbook/backends/file/e-book-backend-file.c
@@ -1111,6 +1111,15 @@ e_book_backend_file_get_contact_list (EBookBackendSync *backend,
                                     E_DATA_BOOK_STATUS_NOT_SUPPORTED,
                                     _("Query '%s' not supported"), query);
                        g_error_free (local_error);
+
+               } else if (g_error_matches (local_error,
+                                    E_BOOK_SDB_ERROR,
+                                    E_BOOK_SDB_ERROR_INVALID_QUERY)) {
+                       g_set_error (perror, E_DATA_BOOK_ERROR,
+                                    E_DATA_BOOK_STATUS_INVALID_QUERY,
+                                    _("Invalid Query '%s'"), query);
+                       g_error_free (local_error);
+
                } else {
                        g_warning ("Failed to fetch contact ids: %s", local_error->message);
                        g_propagate_error (perror, local_error);
@@ -1155,6 +1164,15 @@ e_book_backend_file_get_contact_list_uids (EBookBackendSync *backend,
                                     E_DATA_BOOK_STATUS_NOT_SUPPORTED,
                                     _("Query '%s' not supported"), query);
                        g_error_free (local_error);
+
+               } else if (g_error_matches (local_error,
+                                    E_BOOK_SDB_ERROR,
+                                    E_BOOK_SDB_ERROR_INVALID_QUERY)) {
+                       g_set_error (perror, E_DATA_BOOK_ERROR,
+                                    E_DATA_BOOK_STATUS_INVALID_QUERY,
+                                    _("Invalid Query '%s'"), query);
+                       g_error_free (local_error);
+
                } else {
                        g_warning ("Failed to fetch contact ids: %s", local_error->message);
                        g_propagate_error (perror, local_error);


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