aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-component-registry.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2003-11-20 03:06:46 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2003-11-20 03:06:46 +0800
commit0fede2ff4a1f94b0aab8d8de1988a53ba6e3ba94 (patch)
tree613e724966575f713bb9337c0b528091489ce88a /shell/e-component-registry.c
parent75d7ec9957a7dde363ce353575fb7ddc4826eaff (diff)
downloadgsoc2013-evolution-0fede2ff4a1f94b0aab8d8de1988a53ba6e3ba94.tar.gz
gsoc2013-evolution-0fede2ff4a1f94b0aab8d8de1988a53ba6e3ba94.tar.zst
gsoc2013-evolution-0fede2ff4a1f94b0aab8d8de1988a53ba6e3ba94.zip
Free ->uri_schemas. (set_schemas): New function to get the list of URI
* e-component-registry.c (component_info_free): Free ->uri_schemas. (set_schemas): New function to get the list of URI schemas given a component's ServerInfo. (query_components): Call it. * e-component-registry.h (struct _EComponentInfo): Add "uri_schemas" member. * Evolution-Component.idl (Component.handleURI): New method. svn path=/trunk/; revision=23447
Diffstat (limited to 'shell/e-component-registry.c')
-rw-r--r--shell/e-component-registry.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/shell/e-component-registry.c b/shell/e-component-registry.c
index 474ed06576..6188e3f2eb 100644
--- a/shell/e-component-registry.c
+++ b/shell/e-component-registry.c
@@ -81,6 +81,9 @@ component_info_free (EComponentInfo *info)
if (info->iface != NULL)
bonobo_object_release_unref (info->iface, NULL);
+ g_slist_foreach (info->uri_schemas, (GFunc) g_free, NULL);
+ g_slist_free (info->uri_schemas);
+
g_free (info);
}
@@ -98,6 +101,30 @@ component_info_compare_func (EComponentInfo *a,
/* Utility methods. */
static void
+set_schemas (EComponentInfo *component_info,
+ Bonobo_ServerInfo *server_info)
+{
+ Bonobo_ActivationProperty *property = bonobo_server_info_prop_find (server_info, "evolution:uri_schemas");
+ Bonobo_StringList *list;
+ int i;
+
+ if (property == NULL)
+ return;
+
+ if (property->v._d != Bonobo_ACTIVATION_P_STRINGV) {
+ CORBA_free (property);
+ return;
+ }
+
+ list = & property->v._u.value_stringv;
+
+ for (i = 0; i < list->_length; i ++)
+ component_info->uri_schemas = g_slist_prepend (component_info->uri_schemas, g_strdup (list->_buffer [i]));
+
+ CORBA_free (property);
+}
+
+static void
query_components (EComponentRegistry *registry)
{
Bonobo_ServerInfoList *info_list;
@@ -125,6 +152,7 @@ query_components (EComponentRegistry *registry)
const char *icon_name;
const char *sort_order_string;
GdkPixbuf *icon;
+ EComponentInfo *info;
int sort_order;
id = info_list->_buffer[i].iid;
@@ -149,8 +177,10 @@ query_components (EComponentRegistry *registry)
else
sort_order = atoi (sort_order_string);
- registry->priv->infos = g_slist_prepend (registry->priv->infos,
- component_info_new (id, alias, label, sort_order, icon));
+ info = component_info_new (id, alias, label, sort_order, icon);
+ set_schemas (info, & info_list->_buffer [i]);
+
+ registry->priv->infos = g_slist_prepend (registry->priv->infos, info);
if (icon != NULL)
g_object_unref (icon);