diff options
author | Jesse Pavel <jpavel@src.gnome.org> | 2000-11-07 00:23:10 +0800 |
---|---|---|
committer | Jesse Pavel <jpavel@src.gnome.org> | 2000-11-07 00:23:10 +0800 |
commit | 0981458bf8d699550bf4a6950300ba7a79a05845 (patch) | |
tree | 70a3732b846cae4fd50176be9adf0e9c32bd74e8 /calendar/gui | |
parent | 7bf26ac21b6f29ead92fd5b28b463fe3671a9173 (diff) | |
download | gsoc2013-evolution-0981458bf8d699550bf4a6950300ba7a79a05845.tar gsoc2013-evolution-0981458bf8d699550bf4a6950300ba7a79a05845.tar.gz gsoc2013-evolution-0981458bf8d699550bf4a6950300ba7a79a05845.tar.bz2 gsoc2013-evolution-0981458bf8d699550bf4a6950300ba7a79a05845.tar.lz gsoc2013-evolution-0981458bf8d699550bf4a6950300ba7a79a05845.tar.xz 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')
-rw-r--r-- | calendar/gui/e-itip-control.c | 36 | ||||
-rw-r--r-- | calendar/gui/e-meeting-edit.c | 2 |
2 files changed, 32 insertions, 6 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. */ diff --git a/calendar/gui/e-meeting-edit.c b/calendar/gui/e-meeting-edit.c index 76e5e90143..107dfc66a3 100644 --- a/calendar/gui/e-meeting-edit.c +++ b/calendar/gui/e-meeting-edit.c @@ -688,7 +688,7 @@ send_button_clicked_cb (GtkWidget *widget, gpointer data) CORBA_free (description); CORBA_free (attach_data); - bonobo_object_unref (BONOBO_OBJECT (bonobo_server)); + /* bonobo_object_unref (BONOBO_OBJECT (bonobo_server)); */ } |