[evolution-data-server/openismus-work] Fixed error reporting for direct access apis
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/openismus-work] Fixed error reporting for direct access apis
- Date: Tue, 26 Feb 2013 15:03:01 +0000 (UTC)
commit 3c7d3225deade475c1d954185cf0b04085b4451d
Author: Tristan Van Berkom <tristanvb openismus com>
Date: Tue Feb 26 20:52:20 2013 +0900
Fixed error reporting for direct access apis
When e_data_book_get_contacts[_uids]_finish() is called, the return
value is FALSE if there is any error reported, otherwise it returns
TRUE even if there are no results.
addressbook/libedata-book/e-data-book.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/addressbook/libedata-book/e-data-book.c b/addressbook/libedata-book/e-data-book.c
index 823149d..ecc7363 100644
--- a/addressbook/libedata-book/e-data-book.c
+++ b/addressbook/libedata-book/e-data-book.c
@@ -2217,7 +2217,6 @@ e_data_book_get_contacts_finish (EDataBook *book,
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
ret_contacts = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (result));
- g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error);
if (contacts) {
if (ret_contacts)
@@ -2226,9 +2225,12 @@ e_data_book_get_contacts_finish (EDataBook *book,
*contacts = NULL;
}
- /* How can we tell if it failed ? ... we need to check the error but
- * GSimpleAsyncResult doesnt tell us if there was an error, only propagates it
+ /* If there was an error, the return is FALSE, otherwise
+ * the call was successfull even if no results were found
*/
+ if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error))
+ return FALSE;
+
return TRUE;
}
@@ -2286,7 +2288,6 @@ e_data_book_get_contacts_uids_finish (EDataBook *book,
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
ret_uids = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (result));
- g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error);
if (contacts_uids) {
if (ret_uids)
@@ -2295,9 +2296,12 @@ e_data_book_get_contacts_uids_finish (EDataBook *book,
*contacts_uids = NULL;
}
- /* How can we tell if it failed ? ... we need to check the error but
- * GSimpleAsyncResult doesnt tell us if there was an error, only propagates it
+ /* If there was an error, the return is FALSE, otherwise
+ * the call was successfull even if no results were found
*/
+ if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error))
+ return FALSE;
+
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]