1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
From c66b549c259d33e15947d89257c50d945e3020c7 Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Tue, 14 Jul 2015 11:49:31 +0200
Subject: 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
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);
--
cgit v0.10.2
|