[evolution-mapi] eds-I#286 - Skip collection account refresh when parts disabled



commit 69f6dc2a2239c2c4a183d42c5c4aee2d8783b86e
Author: Milan Crha <mcrha redhat com>
Date:   Thu Jan 7 18:42:54 2021 +0100

    eds-I#286 - Skip collection account refresh when parts disabled
    
    It doesn't make sense to ask the server for existing sources, the less
    the user for credentials to login to the server, when all the related
    parts are disabled.
    
    Related to https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/286

 src/collection/e-mapi-backend.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/collection/e-mapi-backend.c b/src/collection/e-mapi-backend.c
index 017781d..d94a3b6 100644
--- a/src/collection/e-mapi-backend.c
+++ b/src/collection/e-mapi-backend.c
@@ -441,13 +441,12 @@ mapi_backend_source_changed_cb (ESource *source,
                                EMapiBackend *backend)
 {
        /* does nothing currently */
-       if (!e_source_get_enabled (source)) {
+       if (!e_collection_backend_get_part_enabled (E_COLLECTION_BACKEND (backend), 
E_COLLECTION_BACKEND_PART_ANY)) {
                backend->priv->need_update_folders = TRUE;
                return;
        }
 
-       if (e_source_get_enabled (source) &&
-           e_backend_get_online (E_BACKEND (backend)) &&
+       if (e_backend_get_online (E_BACKEND (backend)) &&
            backend->priv->need_update_folders)
                mapi_backend_queue_auth_session (backend);
 }
@@ -511,7 +510,7 @@ mapi_backend_populate (ECollectionBackend *backend)
        mapi_backend->priv->need_update_folders = TRUE;
 
        /* do not do anything, if account is disabled */
-       if (!e_source_get_enabled (source))
+       if (!e_collection_backend_get_part_enabled (backend, E_COLLECTION_BACKEND_PART_ANY))
                return;
 
        if (!e_collection_backend_freeze_populate (backend)) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]