aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shell/ChangeLog13
-rw-r--r--shell/Evolution-Component.idl5
-rw-r--r--shell/e-component-registry.c34
-rw-r--r--shell/e-component-registry.h3
4 files changed, 53 insertions, 2 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index a854194c16..ec1e979946 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,18 @@
2003-11-19 Ettore Perazzoli <ettore@ximian.com>
+ * 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.
+
+2003-11-19 Ettore Perazzoli <ettore@ximian.com>
+
* evolution-activity-client.c
(evolution_activity_client_construct): Get a raw
GNOME_Evolution_Shell as an arg instead of an
diff --git a/shell/Evolution-Component.idl b/shell/Evolution-Component.idl
index 4ccf92431a..0d1af94e75 100644
--- a/shell/Evolution-Component.idl
+++ b/shell/Evolution-Component.idl
@@ -69,6 +69,11 @@ module Evolution {
raises (UnknownType);
+ /*** URI handling (e.g. for the command-line, "evolution
+ mailto:foo@bar.org") ***/
+ void handleURI (in string uri);
+
+
/*** Send/receive. ***/
void sendAndReceive ();
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);
diff --git a/shell/e-component-registry.h b/shell/e-component-registry.h
index 584d7aa209..865bd3fcd2 100644
--- a/shell/e-component-registry.h
+++ b/shell/e-component-registry.h
@@ -70,6 +70,9 @@ struct _EComponentInfo {
GdkPixbuf *button_icon;
int sort_order;
+
+ /* List of URI schemas that this component supports. */
+ GSList *uri_schemas; /* <char *> */
};
typedef struct _EComponentInfo EComponentInfo;