From 0c1e73178599ee4b1b9b661fb6a1d0729eed67fb Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 25 Jul 2012 17:36:59 -0400 Subject: ESourceConfig: Enable remote resource creation. --- widgets/misc/e-source-config.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'widgets/misc') diff --git a/widgets/misc/e-source-config.c b/widgets/misc/e-source-config.c index baf09a3b37..79d2e24f61 100644 --- a/widgets/misc/e-source-config.c +++ b/widgets/misc/e-source-config.c @@ -422,19 +422,21 @@ source_config_init_for_adding_source (ESourceConfig *config) if (backend == NULL) continue; + /* Some backends disallow creating certain types of + * resources. For example, the Exchange Web Services + * backend disallows creating new memo lists. */ + if (!e_source_config_backend_allow_creation (backend)) + continue; + scratch_source = e_source_new (NULL, NULL, NULL); g_return_if_fail (scratch_source != NULL); e_source_set_parent (scratch_source, parent_uid); - /* XXX Leave this disabled until we actually support - * creating remote resources through ESourceConfig. */ -#if 0 g_tree_insert ( scratch_source_tree, g_object_ref (scratch_source), g_object_ref (backend)); -#endif g_object_unref (scratch_source); } @@ -723,7 +725,14 @@ source_config_list_eligible_collections (ESourceConfig *config) list = e_source_registry_list_sources (registry, extension_name); for (link = list; link != NULL; link = g_list_next (link)) { - if (!e_source_get_enabled (E_SOURCE (link->data))) + ESource *source = E_SOURCE (link->data); + gboolean elligible; + + elligible = + e_source_get_enabled (source) && + e_source_get_remote_creatable (source); + + if (!elligible) g_queue_push_tail (&trash, link); } -- cgit v1.2.3