[gnome-online-miners] gdata: Use a separate GError variable for local errors
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-miners] gdata: Use a separate GError variable for local errors
- Date: Fri, 2 Sep 2016 08:20:57 +0000 (UTC)
commit b19600b3547730f4dafaf8d6fc00772bf98fb06d
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Aug 31 15:21:36 2016 +0200
gdata: Use a separate GError variable for local errors
This will make it easier to add paged queries.
https://bugzilla.gnome.org/show_bug.cgi?id=770656
src/gom-gdata-miner.c | 22 ++++++++++++++--------
1 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/src/gom-gdata-miner.c b/src/gom-gdata-miner.c
index 29699f9..ac47264 100644
--- a/src/gom-gdata-miner.c
+++ b/src/gom-gdata-miner.c
@@ -811,26 +811,32 @@ query_gdata_documents (GomAccountMinerJob *job,
{
GDataDocumentsQuery *query = NULL;
GDataDocumentsFeed *feed = NULL;
+ GError *local_error;
GList *entries, *l;
query = gdata_documents_query_new (NULL);
gdata_documents_query_set_show_folders (query, TRUE);
+
+ local_error = NULL;
feed = gdata_documents_service_query_documents
(service, query,
- job->cancellable, NULL, NULL, error);
-
- if (feed == NULL)
- goto out;
+ job->cancellable, NULL, NULL, &local_error);
+ if (local_error != NULL)
+ {
+ g_propagate_error (error, local_error);
+ goto out;
+ }
entries = gdata_feed_get_entries (GDATA_FEED (feed));
for (l = entries; l != NULL; l = l->next)
{
- account_miner_job_process_entry (job, service, l->data, error);
+ local_error = NULL;
+ account_miner_job_process_entry (job, service, l->data, &local_error);
- if (*error != NULL)
+ if (local_error != NULL)
{
- g_warning ("Unable to process entry %p: %s", l->data, (*error)->message);
- g_clear_error (error);
+ g_warning ("Unable to process entry %p: %s", l->data, local_error->message);
+ g_error_free (local_error);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]