aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/tasks-component.c
diff options
context:
space:
mode:
authorChenthill Palanisamy <pchen@src.gnome.org>2006-12-04 17:43:51 +0800
committerChenthill Palanisamy <pchen@src.gnome.org>2006-12-04 17:43:51 +0800
commit0db239af79eef98aaae13e887814460c5d0bcfd9 (patch)
tree3eb13a5089130386df0f921cc12505d010384a34 /calendar/gui/tasks-component.c
parente37627d16f5d85cef7e143b32764529ad109d178 (diff)
downloadgsoc2013-evolution-0db239af79eef98aaae13e887814460c5d0bcfd9.tar
gsoc2013-evolution-0db239af79eef98aaae13e887814460c5d0bcfd9.tar.gz
gsoc2013-evolution-0db239af79eef98aaae13e887814460c5d0bcfd9.tar.bz2
gsoc2013-evolution-0db239af79eef98aaae13e887814460c5d0bcfd9.tar.lz
gsoc2013-evolution-0db239af79eef98aaae13e887814460c5d0bcfd9.tar.xz
gsoc2013-evolution-0db239af79eef98aaae13e887814460c5d0bcfd9.tar.zst
gsoc2013-evolution-0db239af79eef98aaae13e887814460c5d0bcfd9.zip
Fixes #270751
svn path=/trunk/; revision=33040
Diffstat (limited to 'calendar/gui/tasks-component.c')
-rw-r--r--calendar/gui/tasks-component.c75
1 files changed, 75 insertions, 0 deletions
diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c
index 1ecdba1811..4e9643dc92 100644
--- a/calendar/gui/tasks-component.c
+++ b/calendar/gui/tasks-component.c
@@ -32,6 +32,7 @@
#include <gconf/gconf-client.h>
#include <libecal/e-cal.h>
#include <libedataserver/e-data-server-util.h>
+#include <libedataserver/e-url.h>
#include <libedataserverui/e-source-selector.h>
#include <shell/e-user-creatable-items-handler.h>
#include <shell/e-component-view.h>
@@ -1154,6 +1155,79 @@ impl_createView (PortableServer_Servant servant,
return BONOBO_OBJREF(ecv);
}
+static void
+impl_handleURI (PortableServer_Servant servant, const char *uri, CORBA_Environment *ev)
+{
+ TasksComponent *tasks_component = TASKS_COMPONENT (bonobo_object_from_servant (servant));
+ TasksComponentPrivate *priv;
+ GList *l;
+ TasksComponentView *view = NULL;
+
+ char *src_uid = NULL;
+ char *uid = NULL;
+ char *rid = NULL;
+
+ priv = tasks_component->priv;
+
+ l = g_list_last (priv->views);
+ if (!l)
+ return;
+
+ view = l->data;
+
+ if (!strncmp (uri, "task:", 5)) {
+ EUri *euri = e_uri_new (uri);
+ const char *p;
+ char *header, *content;
+ size_t len, clen;
+
+ p = euri->query;
+ if (p) {
+ while (*p) {
+ len = strcspn (p, "=&");
+
+ /* If it's malformed, give up. */
+ if (p[len] != '=')
+ break;
+
+ header = (char *) p;
+ header[len] = '\0';
+ p += len + 1;
+
+ clen = strcspn (p, "&");
+
+ content = g_strndup (p, clen);
+ if (!g_ascii_strcasecmp (header, "source-uid")) {
+ src_uid = g_strdup (content);
+ } else if (!g_ascii_strcasecmp (header, "comp-uid")) {
+ uid = g_strdup (content);
+ } else if (!g_ascii_strcasecmp (header, "comp-rid")) {
+ rid = g_strdup (content);
+ }
+ g_free (content);
+
+ p += clen;
+ if (*p == '&') {
+ p++;
+ if (!strcmp (p, "amp;"))
+ p += 4;
+ }
+ }
+
+ if (uid && src_uid) {
+ e_tasks_open_task_id (view->tasks, src_uid, uid, rid);
+ }
+
+ g_free (src_uid);
+ g_free (uid);
+ g_free (rid);
+ }
+ e_uri_free (euri);
+ }
+
+ return;
+}
+
static GNOME_Evolution_CreatableItemTypeList *
impl__get_userCreatableItems (PortableServer_Servant servant,
CORBA_Environment *ev)
@@ -1285,6 +1359,7 @@ tasks_component_class_init (TasksComponentClass *klass)
epv->createView = impl_createView;
epv->_get_userCreatableItems = impl__get_userCreatableItems;
epv->requestCreateItem = impl_requestCreateItem;
+ epv->handleURI = impl_handleURI;
object_class->dispose = impl_dispose;
object_class->finalize = impl_finalize;