[evolution] ESourceConfig: Enable remote resource creation.



commit 0c1e73178599ee4b1b9b661fb6a1d0729eed67fb
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed Jul 25 17:36:59 2012 -0400

    ESourceConfig: Enable remote resource creation.

 widgets/misc/e-source-config.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/widgets/misc/e-source-config.c b/widgets/misc/e-source-config.c
index baf09a3..79d2e24 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);
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]