[evolution-mapi] [GAL] Do not use partial updates when marked for offline
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-mapi] [GAL] Do not use partial updates when marked for offline
- Date: Mon, 9 Jan 2012 18:29:56 +0000 (UTC)
commit f8db7af2dd6af5d90945a9e3d4a909541d59cfa5
Author: Milan Crha <mcrha redhat com>
Date: Mon Jan 9 19:27:47 2012 +0100
[GAL] Do not use partial updates when marked for offline
Also update book views with contacts in cache when completing after
cache update, thus also already stored contacts are shown in the view.
src/addressbook/e-book-backend-mapi-gal.c | 4 +++-
src/addressbook/e-book-backend-mapi.c | 9 ++++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-mapi-gal.c b/src/addressbook/e-book-backend-mapi-gal.c
index 1b1990d..0c7b549 100644
--- a/src/addressbook/e-book-backend-mapi-gal.c
+++ b/src/addressbook/e-book-backend-mapi-gal.c
@@ -188,7 +188,9 @@ ebbm_gal_transfer_contacts (EBookBackendMAPI *ebma,
}
source = e_backend_get_source (E_BACKEND (ebma));
- if (source && g_strcmp0 (e_source_get_property (source, "allow-partial"), "true") == 0) {
+ if (source &&
+ !e_book_backend_mapi_is_marked_for_offline (ebma) &&
+ g_strcmp0 (e_source_get_property (source, "allow-partial"), "true") == 0) {
const gchar *partial_count_str = e_source_get_property (source, "partial-count");
partial_count = 0;
diff --git a/src/addressbook/e-book-backend-mapi.c b/src/addressbook/e-book-backend-mapi.c
index 760a833..ee7b98e 100644
--- a/src/addressbook/e-book-backend-mapi.c
+++ b/src/addressbook/e-book-backend-mapi.c
@@ -106,6 +106,13 @@ ebbm_pick_book_view (EBookBackendMAPI *ebma)
static gboolean
complete_view_cb (EDataBookView *view, gpointer user_data)
{
+ EBookBackendMAPI *ebma = user_data;
+
+ g_return_val_if_fail (ebma != NULL, FALSE);
+
+ if (e_book_backend_mapi_book_view_is_running (ebma, view))
+ e_book_backend_mapi_update_view_by_cache (ebma, view, NULL);
+
e_data_book_view_notify_complete (view, NULL);
return TRUE;
@@ -114,7 +121,7 @@ complete_view_cb (EDataBookView *view, gpointer user_data)
static void
complete_views (EBookBackendMAPI *ebma)
{
- e_book_backend_foreach_view (E_BOOK_BACKEND (ebma), complete_view_cb, NULL);
+ e_book_backend_foreach_view (E_BOOK_BACKEND (ebma), complete_view_cb, ebma);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]