[evolution-data-server/gnome-41] I#352 - LDAP: Claim capabilities change on "sync for offline" change
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-41] I#352 - LDAP: Claim capabilities change on "sync for offline" change
- Date: Fri, 17 Sep 2021 09:07:48 +0000 (UTC)
commit dd7850bad706738ada607f1ed8d54f3d6131f03c
Author: Milan Crha <mcrha redhat com>
Date: Fri Sep 17 11:05:23 2021 +0200
I#352 - LDAP: Claim capabilities change on "sync for offline" change
Closes https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/352
.../backends/ldap/e-book-backend-ldap.c | 32 ++++++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)
---
diff --git a/src/addressbook/backends/ldap/e-book-backend-ldap.c
b/src/addressbook/backends/ldap/e-book-backend-ldap.c
index 934cf8b8f..74c1b8961 100644
--- a/src/addressbook/backends/ldap/e-book-backend-ldap.c
+++ b/src/addressbook/backends/ldap/e-book-backend-ldap.c
@@ -144,6 +144,7 @@ struct _EBookBackendLDAPPrivate {
gboolean calEntrySupported;
gboolean evolutionPersonChecked;
gboolean marked_for_offline;
+ gboolean marked_can_browse;
/* our operations */
GRecMutex op_hash_mutex; /* lock also eds_ldap_handler_lock before this lock */
@@ -4996,6 +4997,30 @@ book_backend_ldap_get_backend_property (EBookBackend *backend,
return E_BOOK_BACKEND_CLASS (e_book_backend_ldap_parent_class)->impl_get_backend_property (backend,
prop_name);
}
+static void
+book_backend_ldap_source_changed_cb (ESource *source,
+ gpointer user_data)
+{
+ EBookBackend *backend = user_data;
+ EBookBackendLDAP *bl = user_data;
+
+ g_return_if_fail (E_IS_BOOK_BACKEND_LDAP (bl));
+
+ if ((bl->priv->marked_for_offline ? 0 : 1) != (get_marked_for_offline (backend) ? 1 : 0) ||
+ (bl->priv->marked_can_browse ? 0 : 1) != (can_browse (backend) ? 1 : 0)) {
+ gchar *value;
+
+ bl->priv->marked_for_offline = get_marked_for_offline (backend);
+ bl->priv->marked_can_browse = can_browse (backend);
+
+ value = book_backend_ldap_get_backend_property (backend,
CLIENT_BACKEND_PROPERTY_CAPABILITIES);
+
+ e_book_backend_notify_property_changed (backend, CLIENT_BACKEND_PROPERTY_CAPABILITIES, value);
+
+ g_free (value);
+ }
+}
+
static void
book_backend_ldap_open (EBookBackend *backend,
EDataBook *book,
@@ -5030,8 +5055,8 @@ book_backend_ldap_open (EBookBackend *backend,
extension_name = E_SOURCE_EXTENSION_OFFLINE;
offline_extension = e_source_get_extension (source, extension_name);
- bl->priv->marked_for_offline =
- e_source_offline_get_stay_synchronized (offline_extension);
+ bl->priv->marked_for_offline = e_source_offline_get_stay_synchronized (offline_extension);
+ bl->priv->marked_can_browse = e_source_ldap_get_can_browse (ldap_extension);
bl->priv->security = e_source_ldap_get_security (ldap_extension);
@@ -5112,6 +5137,9 @@ book_backend_ldap_open (EBookBackend *backend,
if (error == NULL && bl->priv->marked_for_offline)
generate_cache (bl);
+ g_signal_connect_object (source, "changed",
+ G_CALLBACK (book_backend_ldap_source_changed_cb), bl, 0);
+
e_data_book_respond_open (book, opid, error);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]