aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-itip-control.c
diff options
context:
space:
mode:
authorJesse Pavel <jpavel@src.gnome.org>2000-11-07 00:23:10 +0800
committerJesse Pavel <jpavel@src.gnome.org>2000-11-07 00:23:10 +0800
commit0981458bf8d699550bf4a6950300ba7a79a05845 (patch)
tree70a3732b846cae4fd50176be9adf0e9c32bd74e8 /calendar/gui/e-itip-control.c
parent7bf26ac21b6f29ead92fd5b28b463fe3671a9173 (diff)
downloadgsoc2013-evolution-0981458bf8d699550bf4a6950300ba7a79a05845.tar.gz
gsoc2013-evolution-0981458bf8d699550bf4a6950300ba7a79a05845.tar.zst
gsoc2013-evolution-0981458bf8d699550bf4a6950300ba7a79a05845.zip
added some checks for the type of an incoming iCal component before
passing it off to the CalComponent routines svn path=/trunk/; revision=6415
Diffstat (limited to 'calendar/gui/e-itip-control.c')
-rw-r--r--calendar/gui/e-itip-control.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c
index 28071be091..193667b9b7 100644
--- a/calendar/gui/e-itip-control.c
+++ b/calendar/gui/e-itip-control.c
@@ -206,6 +206,7 @@ pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream,
EItipControlPrivate *priv = data;
gchar *vcalendar;
gint pos, length, length2;
+ icalcomponent_kind comp_kind;
if (type && g_strcasecmp (type, "text/calendar") != 0 &&
g_strcasecmp (type, "text/x-calendar") != 0) {
@@ -249,11 +250,36 @@ pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream,
return;
}
- priv->cal_comp = cal_component_new ();
- if (cal_component_set_icalcomponent (priv->cal_comp, priv->comp) == FALSE) {
- g_printerr ("e-itip-control.c: I couldn't create a CalComponent from the iTip data.\n");
- gtk_object_unref (GTK_OBJECT (priv->cal_comp));
- }
+ comp_kind = icalcomponent_isa (priv->comp);
+
+ switch (comp_kind) {
+ case ICAL_VEVENT_COMPONENT:
+ case ICAL_VTODO_COMPONENT:
+ case ICAL_VJOURNAL_COMPONENT:
+ priv->cal_comp = cal_component_new ();
+ if (cal_component_set_icalcomponent (priv->cal_comp, priv->comp) == FALSE) {
+ g_printerr ("e-itip-control.c: I couldn't create a CalComponent from the iTip data.\n");
+ gtk_object_unref (GTK_OBJECT (priv->cal_comp));
+ }
+ break;
+ case ICAL_VFREEBUSY_COMPONENT:
+ /* Take care of busy time information. */
+ break;
+ default:
+ /* We don't know what this is, so bail. */
+ {
+ GtkWidget *dialog;
+
+ dialog = gnome_warning_dialog("I don't recognize this type of calendar component.");
+ gnome_dialog_run (GNOME_DIALOG(dialog));
+
+ g_free (vcalendar);
+
+ return;
+ }
+ break;
+ } /* End switch. */
+
/* Okay, good then; now I will pick apart the component to get
all the things I'll show in my control. */