[evolution-data-server] Google backend considers each discovered source as new



commit 5136d2e6c3aadb12566f7c7c7c122dfabf61c341
Author: Milan Crha <mcrha redhat com>
Date:   Tue May 26 14:08:54 2015 +0200

    Google backend considers each discovered source as new
    
    It makes for example color changes being done by a user lost, while
    the ownCloud backend does this right.

 modules/google-backend/module-google-backend.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/modules/google-backend/module-google-backend.c b/modules/google-backend/module-google-backend.c
index 3255d6d..b0260b1 100644
--- a/modules/google-backend/module-google-backend.c
+++ b/modules/google-backend/module-google-backend.c
@@ -539,9 +539,31 @@ google_backend_populate (ECollectionBackend *backend)
 {
        GList *list, *link;
        gboolean have_tasks = FALSE;
+       ESourceRegistryServer *server;
        ESourceCollection *collection_extension;
        ESource *source;
 
+       server = e_collection_backend_ref_server (backend);
+       list = e_collection_backend_claim_all_resources (backend);
+       for (link = list; link; link = g_list_next (link)) {
+               ESource *source = link->data;
+
+               if (e_source_has_extension (source, E_SOURCE_EXTENSION_RESOURCE)) {
+                       ESourceResource *resource;
+                       ESource *child;
+
+                       resource = e_source_get_extension (source, E_SOURCE_EXTENSION_RESOURCE);
+                       child = e_collection_backend_new_child (backend, e_source_resource_get_identity 
(resource));
+                       if (child) {
+                               e_source_registry_server_add_source (server, source);
+                               g_object_unref (child);
+                       }
+               }
+       }
+
+       g_list_free_full (list, g_object_unref);
+       g_object_unref (server);
+
        list = e_collection_backend_list_calendar_sources (backend);
        for (link = list; link && !have_tasks; link = g_list_next (link)) {
                ESource *source = link->data;


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