[evolution-data-server/639605-google-contacts-async: 13/15] Don't enter live mode if the Google Contacts backend is already in it
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/639605-google-contacts-async: 13/15] Don't enter live mode if the Google Contacts backend is already in it
- Date: Sat, 15 Jan 2011 15:20:59 +0000 (UTC)
commit 63cd894bb2ec07394f9cf5698fdcd4167ede0056
Author: Philip Withnall <philip tecnocode co uk>
Date: Sun Nov 21 01:15:35 2010 +0000
Don't enter live mode if the Google Contacts backend is already in it
.../backends/google/e-book-backend-google.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/addressbook/backends/google/e-book-backend-google.c b/addressbook/backends/google/e-book-backend-google.c
index fe0d711..31d2fd0 100644
--- a/addressbook/backends/google/e-book-backend-google.c
+++ b/addressbook/backends/google/e-book-backend-google.c
@@ -1167,15 +1167,20 @@ set_live_mode (EBookBackend *backend, gboolean live_mode)
EBookBackendGooglePrivate *priv = E_BOOK_BACKEND_GOOGLE (backend)->priv;
__debug__ (G_STRFUNC);
+
+ if (priv->live_mode == live_mode)
+ return;
+
priv->live_mode = live_mode;
- if (!live_mode && priv->refresh_id > 0) {
+ if (live_mode) {
+ /* Entering live mode, we need to refresh */
+ cache_refresh_if_needed (backend);
+ } else if (priv->refresh_id > 0) {
+ /* Leaving live mode, we can stop periodically refreshing */
g_source_remove (priv->refresh_id);
priv->refresh_id = 0;
}
-
- if (priv->live_mode)
- cache_refresh_if_needed (backend);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]