[evolution-data-server/gnome-3-16] Doesn't honor Google settings as defined in gnome-online-accounts
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-16] Doesn't honor Google settings as defined in gnome-online-accounts
- Date: Tue, 14 Jul 2015 09:53:30 +0000 (UTC)
commit c66b549c259d33e15947d89257c50d945e3020c7
Author: Milan Crha <mcrha redhat com>
Date: Tue Jul 14 11:49:31 2015 +0200
Doesn't honor Google settings as defined in gnome-online-accounts
Use mail-disabled, calendar-disabled and contacts-disabled properties,
rather than rely on an interface addition/removal and a notification
about the change.
Reported at https://bugzilla.redhat.com/show_bug.cgi?id=1242541
.../module-gnome-online-accounts.c | 71 +++-----------------
1 files changed, 9 insertions(+), 62 deletions(-)
---
diff --git a/modules/gnome-online-accounts/module-gnome-online-accounts.c
b/modules/gnome-online-accounts/module-gnome-online-accounts.c
index e800c23..2f9be5e 100644
--- a/modules/gnome-online-accounts/module-gnome-online-accounts.c
+++ b/modules/gnome-online-accounts/module-gnome-online-accounts.c
@@ -162,50 +162,6 @@ gnome_online_accounts_provider_type_to_backend_name (GBinding *binding,
return TRUE;
}
-static gboolean
-gnome_online_accounts_object_is_non_null (GBinding *binding,
- const GValue *source_value,
- GValue *target_value,
- gpointer unused)
-{
- GoaObject *goa_object = GOA_OBJECT (g_binding_get_source (binding));
- ESourceExtension *source_extension = E_SOURCE_EXTENSION (g_binding_get_target (binding));
- ESource *source;
- ESourceGoa *goa_extension;
- gpointer v_object;
-
- v_object = g_value_get_object (source_value);
- g_value_set_boolean (target_value, v_object != NULL);
-
- g_return_val_if_fail (goa_object != NULL, TRUE);
- g_return_val_if_fail (source_extension != NULL, TRUE);
-
- source = e_source_extension_get_source (source_extension);
- goa_extension = e_source_get_extension (source, E_SOURCE_EXTENSION_GOA);
-
- if (g_strcmp0 (g_binding_get_source_property (binding), "calendar") == 0) {
- gchar *uri = NULL;
-
- if (v_object && GOA_IS_CALENDAR (v_object))
- uri = goa_calendar_dup_uri (v_object);
-
- e_source_goa_set_calendar_url (goa_extension, uri);
-
- g_free (uri);
- } else if (g_strcmp0 (g_binding_get_source_property (binding), "contacts") == 0) {
- gchar *uri = NULL;
-
- if (v_object && GOA_IS_CONTACTS (v_object))
- uri = goa_contacts_dup_uri (v_object);
-
- e_source_goa_set_contacts_url (goa_extension, uri);
-
- g_free (uri);
- }
-
- return TRUE;
-}
-
static GoaObject *
gnome_online_accounts_ref_account (EGnomeOnlineAccounts *extension,
ESource *source)
@@ -629,29 +585,20 @@ gnome_online_accounts_config_collection (EGnomeOnlineAccounts *extension,
source_extension, "identity",
G_BINDING_SYNC_CREATE);
- e_binding_bind_property_full (
- goa_object, "calendar",
+ e_binding_bind_property (
+ goa_account, "calendar-disabled",
source_extension, "calendar-enabled",
- G_BINDING_SYNC_CREATE,
- gnome_online_accounts_object_is_non_null,
- NULL,
- NULL, (GDestroyNotify) NULL);
+ G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN);
- e_binding_bind_property_full (
- goa_object, "contacts",
+ e_binding_bind_property (
+ goa_account, "contacts-disabled",
source_extension, "contacts-enabled",
- G_BINDING_SYNC_CREATE,
- gnome_online_accounts_object_is_non_null,
- NULL,
- NULL, (GDestroyNotify) NULL);
+ G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN);
- e_binding_bind_property_full (
- goa_object, "mail",
+ e_binding_bind_property (
+ goa_account, "mail-disabled",
source_extension, "mail-enabled",
- G_BINDING_SYNC_CREATE,
- gnome_online_accounts_object_is_non_null,
- NULL,
- NULL, (GDestroyNotify) NULL);
+ G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN);
g_clear_object (&goa_account);
g_clear_object (&goa_calendar);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]