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