Hello community,

here is the log from the commit of package evolution-data-server for 
openSUSE:Factory checked in at 2018-08-03 12:30:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/evolution-data-server (Old)
 and      /work/SRC/openSUSE:Factory/.evolution-data-server.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "evolution-data-server"

Fri Aug  3 12:30:49 2018 rev:195 rq:626761 version:3.28.5

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/evolution-data-server/evolution-data-server.changes  
    2018-07-27 10:58:21.173888926 +0200
+++ 
/work/SRC/openSUSE:Factory/.evolution-data-server.new/evolution-data-server.changes
 2018-08-03 12:30:52.751000005 +0200
@@ -1,0 +2,10 @@
+Tue Jul 31 06:24:30 UTC 2018 - [email protected]
+
+- Update to version 3.28.5:
+  + ESourceRegistry's thread main_context can leak.
+  + [EClient] Really default readonly property to FALSE.
+  + Bugs fixed: glgo#GNOME/evolution-data-server#19,
+    glgo#GNOME/evolution-data-server#22.
+  + Updated translations.
+
+-------------------------------------------------------------------

Old:
----
  evolution-data-server-3.28.4.tar.xz

New:
----
  evolution-data-server-3.28.5.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ evolution-data-server.spec ++++++
--- /var/tmp/diff_new_pack.3KtjZ2/_old  2018-08-03 12:30:53.367000912 +0200
+++ /var/tmp/diff_new_pack.3KtjZ2/_new  2018-08-03 12:30:53.375000923 +0200
@@ -30,7 +30,7 @@
 %define so_edata_cal 28
 %define _evo_version 3.28
 Name:           evolution-data-server
-Version:        3.28.4
+Version:        3.28.5
 Release:        0
 Summary:        Evolution Data Server
 License:        LGPL-2.1-or-later

++++++ evolution-data-server-3.28.4.tar.xz -> 
evolution-data-server-3.28.5.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evolution-data-server-3.28.4/CMakeLists.txt 
new/evolution-data-server-3.28.5/CMakeLists.txt
--- old/evolution-data-server-3.28.4/CMakeLists.txt     2018-07-16 
12:42:35.000000000 +0200
+++ new/evolution-data-server-3.28.5/CMakeLists.txt     2018-07-30 
15:17:06.000000000 +0200
@@ -4,7 +4,7 @@
 cmake_policy(VERSION 3.1)
 
 project(evolution-data-server
-       VERSION 3.28.4
+       VERSION 3.28.5
        LANGUAGES C CXX)
 set(CMAKE_CXX_STANDARD 14)
 set(PROJECT_BUGREPORT 
"https://gitlab.gnome.org/GNOME/evolution-data-server/issues/";)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evolution-data-server-3.28.4/NEWS 
new/evolution-data-server-3.28.5/NEWS
--- old/evolution-data-server-3.28.4/NEWS       2018-07-16 12:42:35.000000000 
+0200
+++ new/evolution-data-server-3.28.5/NEWS       2018-07-30 15:17:06.000000000 
+0200
@@ -1,3 +1,17 @@
+Evolution-Data-Server 3.28.5 2018-07-30
+---------------------------------------
+
+Bug Fixes:
+       I#22 - [Camel] Store disconnect can abort just started downsync for 
offline (Milan Crha)
+       I#19 - Check also /var/db/zoneinfo when looking for system timezone 
(Milan Crha)
+
+Miscellaneous:
+       ESourceRegistry's thread main_context can leak (Milan Crha)
+       [EClient] Really default readonly property to FALSE (Milan Crha)
+
+Translations:
+       Guillaume Bernard (fr)
+
 Evolution-Data-Server 3.28.4 2018-07-16
 ---------------------------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evolution-data-server-3.28.4/po/fr.po 
new/evolution-data-server-3.28.5/po/fr.po
--- old/evolution-data-server-3.28.4/po/fr.po   2018-07-16 12:42:35.000000000 
+0200
+++ new/evolution-data-server-3.28.5/po/fr.po   2018-07-30 15:17:06.000000000 
+0200
@@ -23,8 +23,8 @@
 "Project-Id-Version: evolution-data-server HEAD\n"
 "Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?";
 "product=evolution-data-server&keywords=I18N+L10N&component=general\n"
-"POT-Creation-Date: 2018-02-28 21:13+0000\n"
-"PO-Revision-Date: 2018-03-01 12:59+0100\n"
+"POT-Creation-Date: 2018-07-18 17:33+0000\n"
+"PO-Revision-Date: 2018-04-07 14:48+0200\n"
 "Last-Translator: Guillaume Bernard <[email protected]>\n"
 "Language-Team: GNOME French Team <[email protected]>\n"
 "Language: fr\n"
@@ -6609,6 +6609,10 @@
 msgid "On This Computer"
 msgstr "Sur cet ordinateur"
 
+#: ../src/services/evolution-source-registry/builtin/system-proxy.source.in.h:1
+msgid "Default Proxy Settings"
+msgstr "Paramètres du serveur mandataire par défaut"
+
 #: ../src/services/evolution-source-registry/builtin/vfolder.source.in.h:1
 msgid "Search Folders"
 msgstr "Dossiers de recherche"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-data-server-3.28.4/src/calendar/libecal/e-cal-system-timezone.c 
new/evolution-data-server-3.28.5/src/calendar/libecal/e-cal-system-timezone.c
--- 
old/evolution-data-server-3.28.4/src/calendar/libecal/e-cal-system-timezone.c   
    2018-07-16 12:42:35.000000000 +0200
+++ 
new/evolution-data-server-3.28.5/src/calendar/libecal/e-cal-system-timezone.c   
    2018-07-30 15:17:06.000000000 +0200
@@ -35,6 +35,7 @@
 #define ETC_SYSCONFIG_CLOCK "/etc/sysconfig/clock"
 #define ETC_CONF_D_CLOCK    "/etc/conf.d/clock"
 #define ETC_LOCALTIME       "/etc/localtime"
+#define VAR_DB_ZONEINFO     "/var/db/zoneinfo"
 
 #define TZ_MAGIC "TZif"
 
@@ -66,7 +67,7 @@
 
 /* Read the soft symlink from /etc/localtime */
 static gchar *
-system_timezone_read_etc_localtime_softlink (GHashTable *ical_zones)
+system_timezone_read_etc_localtime_softlink (void)
 {
        gchar *file;
        gchar *tz;
@@ -81,6 +82,24 @@
        return tz;
 }
 
+/* Read from /var/db/zoneinfo, where tzsetup utility on FreeBSD stores the 
zone name */
+static gchar *
+system_timezone_read_var_db_zoneinfo (void)
+{
+       gchar *tz = NULL;
+
+       if (!g_file_get_contents (VAR_DB_ZONEINFO, &tz, NULL, NULL))
+               return NULL;
+
+       if (tz)
+               g_strchomp (tz);
+
+       if (!tz || !*tz)
+               g_clear_pointer (&tz, g_free);
+
+       return tz;
+}
+
 static gchar *
 system_timezone_read_etc_timezone (GHashTable *ical_zones)
 {
@@ -546,7 +565,9 @@
        }
 
        /* softlink is the best option, it points to the correct file */
-       tz = system_timezone_read_etc_localtime_softlink (ical_zones);
+       tz = system_timezone_read_etc_localtime_softlink ();
+       if (!tz)
+               tz = system_timezone_read_var_db_zoneinfo ();
        if (system_timezone_is_valid (tz, ical_zones)) {
                g_hash_table_destroy (ical_zones);
                return tz;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-data-server-3.28.4/src/camel/camel-offline-folder.c 
new/evolution-data-server-3.28.5/src/camel/camel-offline-folder.c
--- old/evolution-data-server-3.28.4/src/camel/camel-offline-folder.c   
2018-07-16 12:42:35.000000000 +0200
+++ new/evolution-data-server-3.28.5/src/camel/camel-offline-folder.c   
2018-07-30 15:17:06.000000000 +0200
@@ -446,11 +446,29 @@
 
                uids = camel_folder_search_by_expression (folder, search_sexp, 
cancellable, NULL);
 
+               if (camel_debug ("downsync")) {
+                       printf ("[downsync]       %p: (%s : %s): got %d uids 
for limit expr '%s'\n", camel_folder_get_parent_store (folder),
+                               camel_service_get_display_name (CAMEL_SERVICE 
(camel_folder_get_parent_store (folder))), camel_folder_get_full_name (folder),
+                               uids ? uids->len : -1, search_sexp);
+               }
+
                g_free (search_sexp);
        } else if (expression) {
                uids = camel_folder_search_by_expression (folder, expression, 
cancellable, NULL);
+
+               if (camel_debug ("downsync")) {
+                       printf ("[downsync]       %p: (%s : %s): got %d uids 
for expr '%s'\n", camel_folder_get_parent_store (folder),
+                               camel_service_get_display_name (CAMEL_SERVICE 
(camel_folder_get_parent_store (folder))), camel_folder_get_full_name (folder),
+                               uids ? uids->len : -1, expression);
+               }
        } else {
                uids = camel_folder_get_uids (folder);
+
+               if (camel_debug ("downsync")) {
+                       printf ("[downsync]       %p: (%s : %s): got all %d 
uids\n", camel_folder_get_parent_store (folder),
+                               camel_service_get_display_name (CAMEL_SERVICE 
(camel_folder_get_parent_store (folder))), camel_folder_get_full_name (folder),
+                               uids ? uids->len : -1);
+               }
        }
 
        if (!uids)
@@ -463,6 +481,12 @@
        else
                camel_folder_free_uids (folder, uids);
 
+       if (camel_debug ("downsync")) {
+               printf ("[downsync]       %p: (%s : %s): claimed %d uncached 
uids\n", camel_folder_get_parent_store (folder),
+                       camel_service_get_display_name (CAMEL_SERVICE 
(camel_folder_get_parent_store (folder))), camel_folder_get_full_name (folder),
+                       uncached_uids ? uncached_uids->len : -1);
+       }
+
        if (!uncached_uids)
                goto done;
 
@@ -474,8 +498,14 @@
                        CamelMessageInfo *mi;
 
                        mi = camel_folder_get_message_info (folder, uid);
-                       if (!mi)
+                       if (!mi) {
+                               if (camel_debug ("downsync")) {
+                                       printf ("[downsync]          %p: (%s : 
%s): mi for uid '%s' not found, skipping\n", camel_folder_get_parent_store 
(folder),
+                                               camel_service_get_display_name 
(CAMEL_SERVICE (camel_folder_get_parent_store (folder))), 
camel_folder_get_full_name (folder),
+                                               uid);
+                               }
                                continue;
+                       }
 
                        download = camel_message_info_get_date_sent (mi) > 
limit_time;
 
@@ -483,6 +513,7 @@
                }
 
                if (download) {
+                       GError *local_error = NULL;
                        /* Translators: The first “%d” is the sequence number 
of the message, the second “%d”
                           is the total number of messages to synchronize.
                           The first “%s” is replaced with an account name and 
the second “%s”
@@ -494,12 +525,26 @@
                                camel_folder_get_full_name (folder));
 
                        /* Stop on failure */
-                       if (!camel_folder_synchronize_message_sync (folder, 
uid, cancellable, NULL)) {
+                       if (!camel_folder_synchronize_message_sync (folder, 
uid, cancellable, &local_error)) {
+                               if (camel_debug ("downsync")) {
+                                       printf ("[downsync]          %p: (%s : 
%s): aborting, failed to download uid:%s error:%s\n", 
camel_folder_get_parent_store (folder),
+                                               camel_service_get_display_name 
(CAMEL_SERVICE (camel_folder_get_parent_store (folder))), 
camel_folder_get_full_name (folder),
+                                               uid, local_error ? 
local_error->message : "Unknown error");
+                               }
+                               g_clear_error (&local_error);
                                camel_operation_pop_message (cancellable);
                                break;
+                       } else if (camel_debug ("downsync")) {
+                               printf ("[downsync]          %p: (%s : %s): uid 
'%s' downloaded\n", camel_folder_get_parent_store (folder),
+                                       camel_service_get_display_name 
(CAMEL_SERVICE (camel_folder_get_parent_store (folder))), 
camel_folder_get_full_name (folder),
+                                       uid);
                        }
 
                        camel_operation_pop_message (cancellable);
+               } else if (camel_debug ("downsync")) {
+                       printf ("[downsync]       %p: (%s : %s): skipping 
download of uid '%s'\n", camel_folder_get_parent_store (folder),
+                               camel_service_get_display_name (CAMEL_SERVICE 
(camel_folder_get_parent_store (folder))), camel_folder_get_full_name (folder),
+                               uid);
                }
 
                camel_operation_progress (cancellable, i * 100 / 
uncached_uids->len);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-data-server-3.28.4/src/camel/camel-offline-store.c 
new/evolution-data-server-3.28.5/src/camel/camel-offline-store.c
--- old/evolution-data-server-3.28.4/src/camel/camel-offline-store.c    
2018-07-16 12:42:35.000000000 +0200
+++ new/evolution-data-server-3.28.5/src/camel/camel-offline-store.c    
2018-07-30 15:17:06.000000000 +0200
@@ -21,6 +21,7 @@
 
 #include <glib/gi18n-lib.h>
 
+#include "camel-debug.h"
 #include "camel-folder.h"
 #include "camel-network-service.h"
 #include "camel-offline-folder.h"
@@ -50,33 +51,52 @@
 G_DEFINE_TYPE (CamelOfflineStore, camel_offline_store, CAMEL_TYPE_STORE)
 
 static void
-offline_store_downsync_folders_thread (CamelSession *session,
-                                      GCancellable *cancellable,
-                                      gpointer user_data,
-                                      GError **error)
+offline_store_downsync_folders_sync (CamelStore *store,
+                                    GCancellable *cancellable,
+                                    GError **error)
 {
-       CamelStore *store = user_data;
        GPtrArray *folders;
        guint ii;
 
        g_return_if_fail (CAMEL_IS_OFFLINE_STORE (store));
 
        folders = camel_offline_store_dup_downsync_folders (CAMEL_OFFLINE_STORE 
(store));
+
+       if (camel_debug ("downsync"))
+               printf ("[downsync] %p (%s): got %d folders to downsync\n", 
store, camel_service_get_display_name (CAMEL_SERVICE (store)), folders ? 
folders->len : -1);
+
        if (!folders)
                return;
 
        for (ii = 0; ii < folders->len && !g_cancellable_is_cancelled 
(cancellable); ii++) {
                CamelFolder *folder = folders->pdata[ii];
                CamelOfflineFolder *offline_folder;
+               GError *local_error = NULL;
 
-               if (!CAMEL_IS_OFFLINE_FOLDER (folder))
+               if (!CAMEL_IS_OFFLINE_FOLDER (folder)) {
+                       if (camel_debug ("downsync"))
+                               printf ("[downsync]    %p: [%d] not an offline 
folder\n", store, ii);
                        continue;
+               }
 
                offline_folder = CAMEL_OFFLINE_FOLDER (folder);
 
-               if (camel_offline_folder_can_downsync (offline_folder) &&
-                   !camel_offline_folder_downsync_sync (offline_folder, NULL, 
cancellable, error))
+               if (!camel_offline_folder_can_downsync (offline_folder)) {
+                       if (camel_debug ("downsync"))
+                               printf ("[downsync]    %p: [%d] skipping folder 
'%s', not for downsync\n", store, ii, camel_folder_get_full_name (folder));
+                       continue;
+               }
+
+               if (!camel_offline_folder_downsync_sync (offline_folder, NULL, 
cancellable, &local_error)) {
+                       if (camel_debug ("downsync"))
+                               printf ("[downsync]    %p: [%d] failed to 
downsync folder '%s'; cancelled:%d error: %s\n", store, ii, 
camel_folder_get_full_name (folder), g_cancellable_is_cancelled (cancellable), 
local_error ? local_error->message : "Unknown error");
+                       if (local_error)
+                               g_propagate_error (error, local_error);
                        break;
+               }
+
+               if (camel_debug ("downsync"))
+                       printf ("[downsync]    %p: [%d] finished downsync of 
folder '%s'\n", store, ii, camel_folder_get_full_name (folder));
        }
 
        g_ptr_array_foreach (folders, (GFunc) g_object_unref, NULL);
@@ -84,6 +104,17 @@
 }
 
 static void
+offline_store_downsync_folders_thread (CamelSession *session,
+                                      GCancellable *cancellable,
+                                      gpointer user_data,
+                                      GError **error)
+{
+       CamelStore *store = user_data;
+
+       offline_store_downsync_folders_sync (store, cancellable, error);
+}
+
+static void
 offline_store_constructed (GObject *object)
 {
        CamelOfflineStorePrivate *priv;
@@ -262,7 +293,10 @@
                session = camel_service_ref_session (service);
                folders = session ? camel_offline_store_dup_downsync_folders 
(store) : NULL;
 
-               if (folders && session) {
+               /* Schedule job only if the store is going online, otherwise, 
when going offline,
+                  the download could be cancelled due to the switch to the 
disconnect, thus
+                  synchronize immediately. */
+               if (folders && session && online) {
                        gchar *description;
 
                        description = g_strdup_printf (_("Syncing messages in 
account “%s” to disk"),
@@ -273,6 +307,16 @@
                                g_object_ref (store), g_object_unref);
 
                        g_free (description);
+               } else if (folders && session) {
+                       GError *local_error = NULL;
+
+                       /* Ignore errors, because the move to offline won't 
fail here */
+                       offline_store_downsync_folders_sync (CAMEL_STORE 
(store), cancellable, &local_error);
+
+                       if (local_error && camel_debug ("downsync"))
+                               printf ("[downsync]    %p (%s): Finished with 
error when going offline: %s\n", store, camel_service_get_display_name 
(CAMEL_SERVICE (store)), local_error->message);
+
+                       g_clear_error (&local_error);
                }
 
                g_clear_object (&session);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-data-server-3.28.4/src/libebackend/e-backend.c 
new/evolution-data-server-3.28.5/src/libebackend/e-backend.c
--- old/evolution-data-server-3.28.4/src/libebackend/e-backend.c        
2018-07-16 12:42:35.000000000 +0200
+++ new/evolution-data-server-3.28.5/src/libebackend/e-backend.c        
2018-07-30 15:17:06.000000000 +0200
@@ -84,15 +84,22 @@
 
 G_DEFINE_ABSTRACT_TYPE (EBackend, e_backend, G_TYPE_OBJECT)
 
+typedef struct _CanReachData {
+       EBackend *backend;
+       GCancellable *cancellable;
+} CanReachData;
+
 static void
 backend_network_monitor_can_reach_cb (GObject *source_object,
                                       GAsyncResult *result,
                                       gpointer user_data)
 {
-       EBackend *backend = E_BACKEND (user_data);
+       CanReachData *crd = user_data;
        gboolean host_is_reachable;
        GError *error = NULL;
 
+       g_return_if_fail (crd != NULL);
+
        host_is_reachable = g_network_monitor_can_reach_finish (
                G_NETWORK_MONITOR (source_object), result, &error);
 
@@ -101,25 +108,32 @@
                (host_is_reachable && (error == NULL)) ||
                (!host_is_reachable && (error != NULL)));
 
+       g_mutex_lock (&crd->backend->priv->network_monitor_cancellable_lock);
+       if (crd->backend->priv->network_monitor_cancellable == crd->cancellable)
+               g_clear_object 
(&crd->backend->priv->network_monitor_cancellable);
+       g_mutex_unlock (&crd->backend->priv->network_monitor_cancellable_lock);
+
        if (G_IS_IO_ERROR (error, G_IO_ERROR_CANCELLED) ||
-           host_is_reachable == e_backend_get_online (backend)) {
+           host_is_reachable == e_backend_get_online (crd->backend)) {
                g_clear_error (&error);
-               g_object_unref (backend);
+               g_object_unref (crd->backend);
+               g_free (crd);
                return;
        }
 
        g_clear_error (&error);
 
-       e_backend_set_online (backend, host_is_reachable);
+       e_backend_set_online (crd->backend, host_is_reachable);
 
        if (!host_is_reachable) {
                ESource *source;
 
-               source = e_backend_get_source (backend);
+               source = e_backend_get_source (crd->backend);
                e_source_set_connection_status (source, 
E_SOURCE_CONNECTION_STATUS_DISCONNECTED);
        }
 
-       g_object_unref (backend);
+       g_object_unref (crd->backend);
+       g_free (crd);
 }
 
 static GSocketConnectable *
@@ -184,13 +198,19 @@
 
                e_backend_set_online (backend, TRUE);
        } else {
+               CanReachData *crd;
+
                cancellable = g_cancellable_new ();
 
+               crd = g_new0 (CanReachData, 1);
+               crd->backend = g_object_ref (backend);
+               crd->cancellable = cancellable;
+
                g_network_monitor_can_reach_async (
                        backend->priv->network_monitor,
                        connectable, cancellable,
                        backend_network_monitor_can_reach_cb,
-                       g_object_ref (backend));
+                       crd);
 
                backend->priv->network_monitor_cancellable = cancellable;
                g_mutex_unlock 
(&backend->priv->network_monitor_cancellable_lock);
@@ -301,6 +321,15 @@
 authenticate_thread_data_free (AuthenticateThreadData *data)
 {
        if (data) {
+               if (data->backend) {
+                       g_mutex_lock 
(&data->backend->priv->authenticate_cancellable_lock);
+                       if (data->backend->priv->authenticate_cancellable &&
+                           data->backend->priv->authenticate_cancellable == 
data->cancellable) {
+                               g_clear_object 
(&data->backend->priv->authenticate_cancellable);
+                       }
+                       g_mutex_unlock 
(&data->backend->priv->authenticate_cancellable_lock);
+               }
+
                g_clear_object (&data->backend);
                g_clear_object (&data->cancellable);
                e_named_parameters_free (data->credentials);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-data-server-3.28.4/src/libebackend/e-webdav-collection-backend.c 
new/evolution-data-server-3.28.5/src/libebackend/e-webdav-collection-backend.c
--- 
old/evolution-data-server-3.28.4/src/libebackend/e-webdav-collection-backend.c  
    2018-07-16 12:42:35.000000000 +0200
+++ 
new/evolution-data-server-3.28.5/src/libebackend/e-webdav-collection-backend.c  
    2018-07-30 15:17:06.000000000 +0200
@@ -452,6 +452,7 @@
                                           GError **error)
 {
        ECollectionBackend *collection;
+       ESourceRegistryServer *server;
        ESourceCollection *collection_extension;
        ESource *source;
        ESourceAuthenticationResult result;
@@ -488,11 +489,13 @@
        g_list_foreach (sources, webdav_collection_add_uid_to_hashtable, 
known_sources);
        g_list_free_full (sources, g_object_unref);
 
+       server = e_collection_backend_ref_server (collection);
+
        if (e_source_collection_get_calendar_enabled (collection_extension) && 
calendar_url &&
-           e_webdav_discover_sources_sync (source, calendar_url,
+           e_webdav_discover_sources_full_sync (source, calendar_url,
                E_WEBDAV_DISCOVER_SUPPORTS_EVENTS | 
E_WEBDAV_DISCOVER_SUPPORTS_MEMOS | E_WEBDAV_DISCOVER_SUPPORTS_TASKS,
-               credentials, out_certificate_pem, out_certificate_errors,
-               &discovered_sources, NULL, cancellable, &local_error)) {
+               credentials, (EWebDAVDiscoverRefSourceFunc) 
e_source_registry_server_ref_source, server,
+               out_certificate_pem, out_certificate_errors, 
&discovered_sources, NULL, cancellable, &local_error)) {
                EWebDAVDiscoverSupports source_types[] = {
                        E_WEBDAV_DISCOVER_SUPPORTS_EVENTS,
                        E_WEBDAV_DISCOVER_SUPPORTS_MEMOS,
@@ -507,9 +510,9 @@
        }
 
        if (!local_error && e_source_collection_get_contacts_enabled 
(collection_extension) && contacts_url &&
-           e_webdav_discover_sources_sync (source, contacts_url, 
E_WEBDAV_DISCOVER_SUPPORTS_CONTACTS,
-               credentials, out_certificate_pem, out_certificate_errors,
-               &discovered_sources, NULL, cancellable, &local_error)) {
+           e_webdav_discover_sources_full_sync (source, contacts_url, 
E_WEBDAV_DISCOVER_SUPPORTS_CONTACTS,
+               credentials, (EWebDAVDiscoverRefSourceFunc) 
e_source_registry_server_ref_source, server,
+               out_certificate_pem, out_certificate_errors, 
&discovered_sources, NULL, cancellable, &local_error)) {
                EWebDAVDiscoverSupports source_types[] = {
                        E_WEBDAV_DISCOVER_SUPPORTS_CONTACTS
                };
@@ -521,24 +524,19 @@
                any_success = TRUE;
        }
 
-       if (any_success) {
-               ESourceRegistryServer *server;
-
-               server = e_collection_backend_ref_server (collection);
+       if (any_success && server) {
+               RemoveSourcesData rsd;
 
-               if (server) {
-                       RemoveSourcesData rsd;
+               rsd.server = server;
+               rsd.webdav_backend = webdav_backend;
 
-                       rsd.server = server;
-                       rsd.webdav_backend = webdav_backend;
-
-                       g_hash_table_foreach (known_sources, 
webdav_collection_remove_unknown_sources_cb, &rsd);
-                       g_object_unref (server);
-               }
+               g_hash_table_foreach (known_sources, 
webdav_collection_remove_unknown_sources_cb, &rsd);
 
                g_clear_error (&local_error);
        }
 
+       g_clear_object (&server);
+
        if (local_error == NULL) {
                result = E_SOURCE_AUTHENTICATION_ACCEPTED;
                e_collection_backend_authenticate_children (collection, 
credentials);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-data-server-3.28.4/src/libedataserver/e-client.c 
new/evolution-data-server-3.28.5/src/libedataserver/e-client.c
--- old/evolution-data-server-3.28.4/src/libedataserver/e-client.c      
2018-07-16 12:42:35.000000000 +0200
+++ new/evolution-data-server-3.28.5/src/libedataserver/e-client.c      
2018-07-30 15:17:06.000000000 +0200
@@ -945,7 +945,7 @@
 {
        client->priv = E_CLIENT_GET_PRIVATE (client);
 
-       client->priv->readonly = TRUE;
+       client->priv->readonly = FALSE;
        client->priv->main_context = g_main_context_ref_thread_default ();
 
        g_rec_mutex_init (&client->priv->prop_mutex);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-data-server-3.28.4/src/libedataserver/e-source-registry.c 
new/evolution-data-server-3.28.5/src/libedataserver/e-source-registry.c
--- old/evolution-data-server-3.28.4/src/libedataserver/e-source-registry.c     
2018-07-16 12:42:35.000000000 +0200
+++ new/evolution-data-server-3.28.5/src/libedataserver/e-source-registry.c     
2018-07-30 15:17:06.000000000 +0200
@@ -261,6 +261,8 @@
 {
        /* The registry member is not referenced. */
 
+       g_warn_if_fail (!g_main_context_pending (closure->main_context));
+
        g_main_context_unref (closure->main_context);
        g_main_loop_unref (closure->main_loop);
        g_cond_clear (&closure->main_loop_cond);
@@ -1180,6 +1182,13 @@
                g_object_unref (object_manager);
        }
 
+       /* Make sure the queue is flushed, because items in it can reference
+          the main_context, effectively causing it to leak, together with
+          its GWakeup ([eventfd]) file descriptor. */
+       while (g_main_context_pending (closure->main_context)) {
+               g_main_context_iteration (closure->main_context, FALSE);
+       }
+
        g_main_context_pop_thread_default (closure->main_context);
 
        return NULL;
@@ -1292,15 +1301,6 @@
 
        priv = E_SOURCE_REGISTRY_GET_PRIVATE (object);
 
-       /* Terminate the manager thread first. */
-       if (priv->manager_thread != NULL) {
-               g_main_loop_quit (priv->thread_closure->main_loop);
-               g_thread_join (priv->manager_thread);
-               thread_closure_free (priv->thread_closure);
-               priv->manager_thread = NULL;
-               priv->thread_closure = NULL;
-       }
-
        if (priv->dbus_object_manager != NULL) {
                g_object_unref (priv->dbus_object_manager);
                priv->dbus_object_manager = NULL;
@@ -1311,6 +1311,19 @@
                priv->dbus_source_manager = NULL;
        }
 
+       /* Terminate the manager thread after GDBus objects,
+          because they can schedule GSource-s in the main context there. */
+       if (priv->manager_thread != NULL) {
+               g_main_loop_quit (priv->thread_closure->main_loop);
+               g_thread_join (priv->manager_thread);
+               priv->manager_thread = NULL;
+       }
+
+       if (priv->thread_closure) {
+               thread_closure_free (priv->thread_closure);
+               priv->thread_closure = NULL;
+       }
+
        g_hash_table_remove_all (priv->object_path_table);
 
        g_hash_table_remove_all (priv->sources);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-data-server-3.28.4/src/libedataserver/e-webdav-discover.c 
new/evolution-data-server-3.28.5/src/libedataserver/e-webdav-discover.c
--- old/evolution-data-server-3.28.4/src/libedataserver/e-webdav-discover.c     
2018-07-16 12:42:35.000000000 +0200
+++ new/evolution-data-server-3.28.5/src/libedataserver/e-webdav-discover.c     
2018-07-30 15:17:06.000000000 +0200
@@ -307,6 +307,8 @@
        gchar *url_use_path;
        guint32 only_supports;
        ENamedParameters *credentials;
+       EWebDAVDiscoverRefSourceFunc ref_source_func;
+       gpointer ref_source_func_user_data;
        gchar *out_certificate_pem;
        GTlsCertificateFlags out_certificate_errors;
        GSList *out_discovered_sources;
@@ -317,7 +319,9 @@
 e_webdav_discover_context_new (ESource *source,
                               const gchar *url_use_path,
                               guint32 only_supports,
-                              const ENamedParameters *credentials)
+                              const ENamedParameters *credentials,
+                              EWebDAVDiscoverRefSourceFunc ref_source_func,
+                              gpointer ref_source_func_user_data)
 {
        EWebDAVDiscoverContext *context;
 
@@ -326,6 +330,8 @@
        context->url_use_path = g_strdup (url_use_path);
        context->only_supports = only_supports;
        context->credentials = e_named_parameters_new_clone (credentials);
+       context->ref_source_func = ref_source_func;
+       context->ref_source_func_user_data = ref_source_func_user_data;
        context->out_certificate_pem = NULL;
        context->out_certificate_errors = 0;
        context->out_discovered_sources = NULL;
@@ -393,8 +399,9 @@
        g_return_if_fail (context != NULL);
        g_return_if_fail (E_IS_SOURCE (source_object));
 
-       success = e_webdav_discover_sources_sync (E_SOURCE (source_object),
+       success = e_webdav_discover_sources_full_sync (E_SOURCE (source_object),
                context->url_use_path, context->only_supports, 
context->credentials,
+               context->ref_source_func, context->ref_source_func_user_data,
                &context->out_certificate_pem, &context->out_certificate_errors,
                &context->out_discovered_sources, 
&context->out_calendar_user_addresses,
                cancellable, &local_error);
@@ -409,6 +416,8 @@
 static gboolean
 e_webdav_discover_setup_proxy_resolver (EWebDAVSession *webdav,
                                        ESource *cred_source,
+                                       EWebDAVDiscoverRefSourceFunc 
ref_source_func,
+                                       gpointer ref_source_func_user_data,
                                        GCancellable *cancellable,
                                        GError **error)
 {
@@ -428,14 +437,18 @@
        uid = e_source_authentication_dup_proxy_uid (auth_extension);
 
        if (uid != NULL) {
-               ESourceRegistry * registry;
-
-               registry = e_source_registry_new_sync (cancellable, error);
-               if (!registry) {
-                       success = FALSE;
+               if (ref_source_func) {
+                       source = ref_source_func (ref_source_func_user_data, 
uid);
                } else {
-                       source = e_source_registry_ref_source (registry, uid);
-                       g_object_unref (registry);
+                       ESourceRegistry *registry;
+
+                       registry = e_source_registry_new_sync (cancellable, 
error);
+                       if (!registry) {
+                               success = FALSE;
+                       } else {
+                               source = e_source_registry_ref_source 
(registry, uid);
+                               g_object_unref (registry);
+                       }
                }
 
                g_free (uid);
@@ -486,12 +499,51 @@
                           GAsyncReadyCallback callback,
                           gpointer user_data)
 {
+       g_return_if_fail (E_IS_SOURCE (source));
+
+       e_webdav_discover_sources_full (source, url_use_path, only_supports, 
credentials, NULL, NULL, cancellable, callback, user_data);
+}
+
+/**
+ * e_webdav_discover_sources_full:
+ * @source: an #ESource from which to take connection details
+ * @url_use_path: (nullable): optional URL override, or %NULL
+ * @only_supports: bit-or of EWebDAVDiscoverSupports, to limit what type of 
sources to search
+ * @credentials: (nullable): credentials to use for authentication to the 
server
+ * @ref_source_func: (nullable): optional callback to use to get an ESource
+ * @ref_source_func_user_data: (nullable): user data for @ref_source_func
+ * @cancellable: optional #GCancellable object, or %NULL
+ * @callback: (scope async): a #GAsyncReadyCallback to call when the request
+ *            is satisfied
+ * @user_data: (closure): data to pass to the callback function
+ *
+ * This is the same as e_webdav_discover_sources(), it only allows to
+ * provide a callback function (with its user_data), to reference an additional
+ * #ESource. It's good to avoid creating its own #ESourceRegistry instance to
+ * get it.
+ *
+ * When the operation is finished, @callback will be called. You can then
+ * call e_webdav_discover_sources_finish() to get the result of the operation.
+ *
+ * Since: 3.28.5
+ **/
+void
+e_webdav_discover_sources_full (ESource *source,
+                               const gchar *url_use_path,
+                               guint32 only_supports,
+                               const ENamedParameters *credentials,
+                               EWebDAVDiscoverRefSourceFunc ref_source_func,
+                               gpointer ref_source_func_user_data,
+                               GCancellable *cancellable,
+                               GAsyncReadyCallback callback,
+                               gpointer user_data)
+{
        EWebDAVDiscoverContext *context;
        GTask *task;
 
        g_return_if_fail (E_IS_SOURCE (source));
 
-       context = e_webdav_discover_context_new (source, url_use_path, 
only_supports, credentials);
+       context = e_webdav_discover_context_new (source, url_use_path, 
only_supports, credentials, ref_source_func, ref_source_func_user_data);
 
        task = g_task_new (source, cancellable, callback, user_data);
        g_task_set_source_tag (task, e_webdav_discover_sources);
@@ -650,6 +702,55 @@
                                GCancellable *cancellable,
                                GError **error)
 {
+       g_return_val_if_fail (E_IS_SOURCE (source), FALSE);
+
+       return e_webdav_discover_sources_full_sync (source, url_use_path, 
only_supports, credentials, NULL, NULL,
+               out_certificate_pem, out_certificate_errors, 
out_discovered_sources, out_calendar_user_addresses, cancellable, error);
+}
+
+/**
+ * e_webdav_discover_sources_full_sync:
+ * @source: an #ESource from which to take connection details
+ * @url_use_path: (nullable): optional URL override, or %NULL
+ * @only_supports: bit-or of EWebDAVDiscoverSupports, to limit what type of 
sources to search
+ * @credentials: (nullable): credentials to use for authentication to the 
server
+ * @ref_source_func: (nullable): optional callback to use to get an ESource
+ * @ref_source_func_user_data: (nullable): user data for @ref_source_func
+ * @out_certificate_pem: (out) (nullable): optional return location
+ *   for a server SSL certificate in PEM format, when the operation failed
+ *   with an SSL error
+ * @out_certificate_errors: (out) (nullable): optional #GTlsCertificateFlags,
+ *   with certificate error flags when the operation failed with SSL error
+ * @out_discovered_sources: (out) (element-type EWebDAVDiscoveredSource): a 
#GSList
+ *   of all discovered sources
+ * @out_calendar_user_addresses: (out) (nullable) (element-type utf8): a 
#GSList of
+ *   all discovered mail addresses for calendar sources
+ * @cancellable: optional #GCancellable object, or %NULL
+ * @error: return location for a #GError, or %NULL
+ *
+ * This is the same as e_webdav_discover_sources_sync(), it only allows to
+ * provide a callback function (with its user_data), to reference an additional
+ * #ESource. It's good to avoid creating its own #ESourceRegistry instance to
+ * get it.
+ *
+ * Returns: %TRUE on success, %FALSE on failure
+ *
+ * Since: 3.28.5
+ **/
+gboolean
+e_webdav_discover_sources_full_sync (ESource *source,
+                                    const gchar *url_use_path,
+                                    guint32 only_supports,
+                                    const ENamedParameters *credentials,
+                                    EWebDAVDiscoverRefSourceFunc 
ref_source_func,
+                                    gpointer ref_source_func_user_data,
+                                    gchar **out_certificate_pem,
+                                    GTlsCertificateFlags 
*out_certificate_errors,
+                                    GSList **out_discovered_sources,
+                                    GSList **out_calendar_user_addresses,
+                                    GCancellable *cancellable,
+                                    GError **error)
+{
        ESourceWebdav *webdav_extension;
        EWebDAVSession *webdav;
        SoupURI *soup_uri;
@@ -696,7 +797,7 @@
 
        webdav = e_webdav_session_new (source);
 
-       if (!e_webdav_discover_setup_proxy_resolver (webdav, source, 
cancellable, error)) {
+       if (!e_webdav_discover_setup_proxy_resolver (webdav, source, 
ref_source_func, ref_source_func_user_data, cancellable, error)) {
                soup_uri_free (soup_uri);
                g_object_unref (webdav);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-data-server-3.28.4/src/libedataserver/e-webdav-discover.h 
new/evolution-data-server-3.28.5/src/libedataserver/e-webdav-discover.h
--- old/evolution-data-server-3.28.4/src/libedataserver/e-webdav-discover.h     
2018-07-16 12:42:35.000000000 +0200
+++ new/evolution-data-server-3.28.5/src/libedataserver/e-webdav-discover.h     
2018-07-30 15:17:06.000000000 +0200
@@ -74,6 +74,43 @@
                                                         GCancellable 
*cancellable,
                                                         GError **error);
 
+/**
+ * EWebDAVDiscoverRefSourceFunc:
+ * @user_data: user data, as passed to e_webdav_discover_sources_full() or
+ *     e_webdav_discover_sources_full_sync()
+ * @uid: an #ESource UID to return
+ *
+ * Returns: (transfer full) (nullable): an #ESource with UID @uid, or %NULL, 
if not found.
+ *    Dereference the returned non-NULL #ESource with g_object_unref(), when 
no longer needed.
+ *
+ * Since: 3.28.5
+ **/
+typedef ESource * (* EWebDAVDiscoverRefSourceFunc)     (gpointer user_data,
+                                                        const gchar *uid);
+
+void           e_webdav_discover_sources_full          (ESource *source,
+                                                        const gchar 
*url_use_path,
+                                                        guint32 only_supports,
+                                                        const ENamedParameters 
*credentials,
+                                                        
EWebDAVDiscoverRefSourceFunc ref_source_func,
+                                                        gpointer 
ref_source_func_user_data,
+                                                        GCancellable 
*cancellable,
+                                                        GAsyncReadyCallback 
callback,
+                                                        gpointer user_data);
+
+gboolean       e_webdav_discover_sources_full_sync     (ESource *source,
+                                                        const gchar 
*url_use_path,
+                                                        guint32 only_supports,
+                                                        const ENamedParameters 
*credentials,
+                                                        
EWebDAVDiscoverRefSourceFunc ref_source_func,
+                                                        gpointer 
ref_source_func_user_data,
+                                                        gchar 
**out_certificate_pem,
+                                                        GTlsCertificateFlags 
*out_certificate_errors,
+                                                        GSList 
**out_discovered_sources,
+                                                        GSList 
**out_calendar_user_addresses,
+                                                        GCancellable 
*cancellable,
+                                                        GError **error);
+
 G_END_DECLS
 
 #endif /* E_WEBDAV_DISCOVER_H */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-data-server-3.28.4/src/libedataserverui/e-webdav-discover-widget.c
 
new/evolution-data-server-3.28.5/src/libedataserverui/e-webdav-discover-widget.c
--- 
old/evolution-data-server-3.28.4/src/libedataserverui/e-webdav-discover-widget.c
    2018-07-16 12:42:35.000000000 +0200
+++ 
new/evolution-data-server-3.28.5/src/libedataserverui/e-webdav-discover-widget.c
    2018-07-30 15:17:06.000000000 +0200
@@ -580,6 +580,7 @@
        GSimpleAsyncResult *simple;
        gchar *base_url;
        ENamedParameters *credentials;
+       ESourceRegistry *registry;
 } RefreshData;
 
 static void
@@ -608,6 +609,7 @@
                g_clear_object (&rd->content);
                g_clear_object (&rd->cancellable);
                g_clear_object (&rd->simple);
+               g_clear_object (&rd->registry);
                g_free (rd->base_url);
                e_named_parameters_free (rd->credentials);
                g_free (rd);
@@ -640,8 +642,9 @@
                refresh_data_free (rd);
        } else if (response == E_TRUST_PROMPT_RESPONSE_ACCEPT || response == 
E_TRUST_PROMPT_RESPONSE_ACCEPT_TEMPORARILY) {
                /* Use NULL credentials to reuse those from the last time. */
-               e_webdav_discover_sources (source, rd->base_url, 
E_WEBDAV_DISCOVER_SUPPORTS_NONE, rd->credentials, rd->cancellable,
-                       e_webdav_discover_content_refresh_done_cb, rd);
+               e_webdav_discover_sources_full (source, rd->base_url, 
E_WEBDAV_DISCOVER_SUPPORTS_NONE, rd->credentials,
+                       rd->registry ? (EWebDAVDiscoverRefSourceFunc) 
e_source_registry_ref_source : NULL, rd->registry,
+                       rd->cancellable, 
e_webdav_discover_content_refresh_done_cb, rd);
        } else {
                g_cancellable_cancel (rd->cancellable);
                g_warn_if_fail (g_cancellable_set_error_if_cancelled 
(rd->cancellable, &local_error));
@@ -678,8 +681,9 @@
                rd->credentials = credentials;
                credentials = NULL;
 
-               e_webdav_discover_sources (source, rd->base_url, 
E_WEBDAV_DISCOVER_SUPPORTS_NONE, rd->credentials, rd->cancellable,
-                       e_webdav_discover_content_refresh_done_cb, rd);
+               e_webdav_discover_sources_full (source, rd->base_url, 
E_WEBDAV_DISCOVER_SUPPORTS_NONE, rd->credentials,
+                       rd->registry ? (EWebDAVDiscoverRefSourceFunc) 
e_source_registry_ref_source : NULL, rd->registry,
+                       rd->cancellable, 
e_webdav_discover_content_refresh_done_cb, rd);
        }
 
        e_named_parameters_free (credentials);
@@ -850,6 +854,10 @@
        rd->simple = g_simple_async_result_new (G_OBJECT (content), callback, 
user_data, e_webdav_discover_content_refresh);
        rd->base_url = g_strdup (data->base_url);
        rd->credentials = NULL;
+       rd->registry = e_credentials_prompter_get_registry 
(data->credentials_prompter);
+
+       if (rd->registry)
+               g_object_ref (rd->registry);
 
        if (data->source) {
                source = g_object_ref (data->source);
@@ -894,8 +902,9 @@
 
        gtk_grid_attach (GTK_GRID (content), GTK_WIDGET (data->info_bar), 0, 2, 
1, 1);
 
-       e_webdav_discover_sources (source, rd->base_url, 
E_WEBDAV_DISCOVER_SUPPORTS_NONE, rd->credentials, rd->cancellable,
-               e_webdav_discover_content_refresh_done_cb, rd);
+       e_webdav_discover_sources_full (source, rd->base_url, 
E_WEBDAV_DISCOVER_SUPPORTS_NONE, rd->credentials,
+               rd->registry ? (EWebDAVDiscoverRefSourceFunc) 
e_source_registry_ref_source : NULL, rd->registry,
+               rd->cancellable, e_webdav_discover_content_refresh_done_cb, rd);
 
        g_object_unref (source);
        soup_uri_free (soup_uri);


Reply via email to