return FALSE;
}
+static gboolean
+include_master_source_enabled_transform (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer backend)
+{
+ g_value_set_boolean (target_value,
+ g_value_get_boolean (source_value) &&
+ e_source_get_enabled (e_backend_get_source (backend)));
+
+ return TRUE;
+}
+
static void
collection_backend_bind_child_enabled (ECollectionBackend *backend,
ESource *child_source)
extension = e_source_get_extension (collection_source, extension_name);
if (collection_backend_child_is_calendar (child_source)) {
- g_object_bind_property (
+ g_object_bind_property_full (
extension, "calendar-enabled",
child_source, "enabled",
- G_BINDING_SYNC_CREATE);
+ G_BINDING_SYNC_CREATE,
+ include_master_source_enabled_transform,
+ include_master_source_enabled_transform,
+ backend,
+ NULL);
return;
}
if (collection_backend_child_is_contacts (child_source)) {
- g_object_bind_property (
+ g_object_bind_property_full (
extension, "contacts-enabled",
child_source, "enabled",
- G_BINDING_SYNC_CREATE);
+ G_BINDING_SYNC_CREATE,
+ include_master_source_enabled_transform,
+ include_master_source_enabled_transform,
+ backend,
+ NULL);
return;
}
if (collection_backend_child_is_mail (child_source)) {
- g_object_bind_property (
+ g_object_bind_property_full (
extension, "mail-enabled",
child_source, "enabled",
- G_BINDING_SYNC_CREATE);
+ G_BINDING_SYNC_CREATE,
+ include_master_source_enabled_transform,
+ include_master_source_enabled_transform,
+ backend,
+ NULL);
return;
}
}