diff -up evolution-mapi-3.12.10/src/addressbook/e-book-backend-mapi.c.book-recognize-offline evolution-mapi-3.12.10/src/addressbook/e-book-backend-mapi.c
--- evolution-mapi-3.12.10/src/addressbook/e-book-backend-mapi.c.book-recognize-offline 2014-10-14 14:42:49.000000000 +0200
+++ evolution-mapi-3.12.10/src/addressbook/e-book-backend-mapi.c 2016-08-16 17:33:31.513852020 +0200
@@ -54,7 +54,6 @@ struct _EBookBackendMAPIPrivate
GRecMutex conn_lock;
EMapiConnection *conn;
gchar *book_uid;
- gboolean marked_for_offline;
GThread *update_cache_thread;
GCancellable *update_cache;
@@ -415,7 +414,7 @@ ebbm_connect_user (EBookBackendMAPI *ebm
ebbm_notify_connection_status (ebma, TRUE);
- if (!g_cancellable_is_cancelled (cancellable) && priv->marked_for_offline) {
+ if (!g_cancellable_is_cancelled (cancellable) && e_book_backend_mapi_is_marked_for_offline (ebma)) {
ebbm_maybe_invoke_cache_update (ebma);
}
}
@@ -484,16 +483,12 @@ ebbm_open (EBookBackendMAPI *ebma,
{
EBookBackendMAPIPrivate *priv = ebma->priv;
ESource *source = e_backend_get_source (E_BACKEND (ebma));
- ESourceOffline *offline_extension;
const gchar *cache_dir;
GError *error = NULL;
if (e_book_backend_is_opened (E_BOOK_BACKEND (ebma)))
return;
- offline_extension = e_source_get_extension (source, E_SOURCE_EXTENSION_OFFLINE);
- priv->marked_for_offline = e_source_offline_get_stay_synchronized (offline_extension);
-
if (priv->book_uid)
g_free (priv->book_uid);
priv->book_uid = e_source_dup_uid (source);
@@ -519,7 +514,7 @@ ebbm_open (EBookBackendMAPI *ebma,
/* Either we are in Online mode or this is marked for offline */
if (!e_backend_get_online (E_BACKEND (ebma)) &&
- !priv->marked_for_offline) {
+ !e_book_backend_mapi_is_marked_for_offline (ebma)) {
g_propagate_error (perror, EDB_ERROR (OFFLINE_UNAVAILABLE));
return;
}
@@ -742,7 +737,7 @@ ebbm_book_view_thread (gpointer data)
if (ebmac && ebmac->op_book_view_thread)
ebmac->op_book_view_thread (bvtd->ebma, bvtd->book_view, priv->update_cache, &error);
- if (priv->marked_for_offline) {
+ if (e_book_backend_mapi_is_marked_for_offline (bvtd->ebma)) {
e_book_backend_mapi_update_view_by_cache (bvtd->ebma, bvtd->book_view, &error);
ebbm_maybe_invoke_cache_update (bvtd->ebma);
@@ -1505,10 +1500,17 @@ e_book_backend_mapi_book_view_is_running
gboolean
e_book_backend_mapi_is_marked_for_offline (EBookBackendMAPI *ebma)
{
+ ESource *source;
+ ESourceOffline *offline_extension;
+
g_return_val_if_fail (E_IS_BOOK_BACKEND_MAPI (ebma), FALSE);
g_return_val_if_fail (ebma->priv != NULL, FALSE);
- return ebma->priv->marked_for_offline;
+ source = e_backend_get_source (E_BACKEND (ebma));
+
+ offline_extension = e_source_get_extension (source, E_SOURCE_EXTENSION_OFFLINE);
+
+ return e_source_offline_get_stay_synchronized (offline_extension);
}
void