aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-04-21 00:30:04 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-04-21 01:17:53 +0800
commitd64f3f956b5bc89e2c046d3c881f916a914ff7fe (patch)
treeceef342196e80b891f631d79eb61b52c7d12cbf3 /e-util
parente423a12c6ca197d37062f55a67f697c19d67941e (diff)
downloadgsoc2013-evolution-d64f3f956b5bc89e2c046d3c881f916a914ff7fe.tar
gsoc2013-evolution-d64f3f956b5bc89e2c046d3c881f916a914ff7fe.tar.gz
gsoc2013-evolution-d64f3f956b5bc89e2c046d3c881f916a914ff7fe.tar.bz2
gsoc2013-evolution-d64f3f956b5bc89e2c046d3c881f916a914ff7fe.tar.lz
gsoc2013-evolution-d64f3f956b5bc89e2c046d3c881f916a914ff7fe.tar.xz
gsoc2013-evolution-d64f3f956b5bc89e2c046d3c881f916a914ff7fe.tar.zst
gsoc2013-evolution-d64f3f956b5bc89e2c046d3c881f916a914ff7fe.zip
EPhotoCache: Fix a runtime warning.
Stop searching address books on the first error but don't indicate failure if we've managed to accumulate contacts prior to the error. (cherry picked from commit 5e1934425ddedb3848a66f16100e4ee1ea12aeb1)
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-photo-cache.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/e-util/e-photo-cache.c b/e-util/e-photo-cache.c
index 38d86a780f..74de1e9b7c 100644
--- a/e-util/e-photo-cache.c
+++ b/e-util/e-photo-cache.c
@@ -378,6 +378,7 @@ photo_cache_find_contacts (EPhotoCache *photo_cache,
ESource *source = E_SOURCE (link->data);
EClient *client;
GSList *contact_list = NULL;
+ GError *local_error = NULL;
/* Skip disabled sources. */
if (!e_source_get_enabled (source))
@@ -386,21 +387,37 @@ photo_cache_find_contacts (EPhotoCache *photo_cache,
client = e_client_cache_get_client_sync (
client_cache, source,
E_SOURCE_EXTENSION_ADDRESS_BOOK,
- cancellable, error);
-
- if (client == NULL) {
- success = FALSE;
+ cancellable, &local_error);
+
+ if (local_error != NULL) {
+ g_warn_if_fail (client == NULL);
+ if (g_queue_is_empty (out_contacts)) {
+ g_propagate_error (error, local_error);
+ success = FALSE;
+ } else {
+ /* Clear the error if we already
+ * have matching contacts queued. */
+ g_clear_error (&local_error);
+ }
break;
}
- success = e_book_client_get_contacts_sync (
+ e_book_client_get_contacts_sync (
E_BOOK_CLIENT (client), book_query_string,
- &contact_list, cancellable, error);
+ &contact_list, cancellable, &local_error);
g_object_unref (client);
- if (!success) {
+ if (local_error != NULL) {
g_warn_if_fail (contact_list == NULL);
+ if (g_queue_is_empty (out_contacts)) {
+ g_propagate_error (error, local_error);
+ success = FALSE;
+ } else {
+ /* Clear the error if we already
+ * have matching contacts queued. */
+ g_clear_error (&local_error);
+ }
break;
}