[evolution-data-server] I#203 - Google book: Do not use progress callbacks in libgdata sync API
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] I#203 - Google book: Do not use progress callbacks in libgdata sync API
- Date: Mon, 30 Mar 2020 16:01:22 +0000 (UTC)
commit 170dd1b2ca4a7598d714f6f582373c8f33b1412e
Author: Milan Crha <mcrha redhat com>
Date: Mon Mar 30 18:03:02 2020 +0200
I#203 - Google book: Do not use progress callbacks in libgdata sync API
These are always delivered in the main thread, on idle, regardless
the libgdata API being called is synchronous.
Closes https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/203
.../backends/google/e-book-backend-google.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/src/addressbook/backends/google/e-book-backend-google.c
b/src/addressbook/backends/google/e-book-backend-google.c
index 378be85b3..4597169eb 100644
--- a/src/addressbook/backends/google/e-book-backend-google.c
+++ b/src/addressbook/backends/google/e-book-backend-google.c
@@ -238,18 +238,13 @@ ebb_google_cache_update_group (EBookBackendGoogle *bbgoogle,
}
static void
-ebb_google_process_group (GDataEntry *entry,
- guint entry_key,
- guint entry_count,
- gpointer user_data)
+ebb_google_process_group (EBookBackendGoogle *bbgoogle,
+ GDataEntry *entry)
{
- EBookBackendGoogle *bbgoogle = user_data;
const gchar *uid, *system_group_id;
gchar *name;
gboolean is_deleted;
- g_return_if_fail (E_IS_BOOK_BACKEND_GOOGLE (bbgoogle));
-
uid = gdata_entry_get_id (entry);
name = e_contact_sanitise_google_group_name (entry);
@@ -328,7 +323,7 @@ ebb_google_get_groups_locked_sync (EBookBackendGoogle *bbgoogle,
/* Run the query synchronously */
feed = gdata_contacts_service_query_groups (
GDATA_CONTACTS_SERVICE (bbgoogle->priv->service),
- query, cancellable, ebb_google_process_group, bbgoogle, &local_error);
+ query, cancellable, NULL, NULL, &local_error);
if (with_time_constraint && bbgoogle->priv->groups_last_update.tv_sec != 0 && (
g_error_matches (local_error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_BAD_QUERY_PARAMETER) ||
@@ -339,15 +334,22 @@ ebb_google_get_groups_locked_sync (EBookBackendGoogle *bbgoogle,
feed = gdata_contacts_service_query_groups (
GDATA_CONTACTS_SERVICE (bbgoogle->priv->service),
- query, cancellable, ebb_google_process_group, bbgoogle, error);
+ query, cancellable, NULL, NULL, error);
} else if (local_error) {
g_propagate_error (error, local_error);
}
success = feed != NULL;
- if (success)
+ if (success) {
+ GList *link;
+
+ for (link = gdata_feed_get_entries (feed); link; link = g_list_next (link)) {
+ ebb_google_process_group (bbgoogle, link->data);
+ }
+
g_get_current_time (&bbgoogle->priv->groups_last_update);
+ }
g_rec_mutex_unlock (&bbgoogle->priv->groups_lock);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]