From b4300c6748056cf795acf70b57a33c19a7f5671f Mon Sep 17 00:00:00 2001 From: Parthasarathi Susarla Date: Tue, 28 Nov 2006 18:26:29 +0000 Subject: ** Fix bug #348679 2006-11-28 Parthasarathi Susarla ** Fix bug #348679 * icsimporter.c: (org_gnome_evolution_import_ics_attachment): Do not access structure elements directly. Use the methods of the class in the CamelDataWrapper Class svn path=/trunk/; revision=33030 --- plugins/import-ics-attachments/icsimporter.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'plugins/import-ics-attachments/icsimporter.c') diff --git a/plugins/import-ics-attachments/icsimporter.c b/plugins/import-ics-attachments/icsimporter.c index f9986d7294..1ffaa563de 100644 --- a/plugins/import-ics-attachments/icsimporter.c +++ b/plugins/import-ics-attachments/icsimporter.c @@ -95,23 +95,28 @@ void org_gnome_evolution_import_ics_attachments (EPlugin *ep, EMPopupTargetAttac icalcomponent_kind kind; int len = 0; int i = 0; + CamelContentType *type; len = g_slist_length(t->attachments); - if (len !=1 || !camel_content_type_is(((CamelDataWrapper *) ((EAttachment *) t->attachments->data)->body)->mime_type, "text", "calendar")) + if (len != 1) return; - + + type = camel_data_wrapper_get_mime_type_field (((CamelDataWrapper *) ((EAttachment *) t->attachments->data)->body)); + if (type && camel_content_type_is(type, "text", "calendar")) { + kind = get_menu_type (t); - if (kind == ICAL_VTODO_COMPONENT ) { - for (i = 0; i < sizeof (popup_tasks_items) / sizeof (popup_tasks_items[0]); i++) - menus = g_slist_prepend (menus, &popup_tasks_items[i]); - } else if ( kind == ICAL_VEVENT_COMPONENT) { - for (i = 0; i < sizeof (popup_calendar_items) / sizeof (popup_calendar_items[0]); i++) - menus = g_slist_prepend (menus, &popup_calendar_items[i]); - } + if (kind == ICAL_VTODO_COMPONENT ) { + for (i = 0; i < sizeof (popup_tasks_items) / sizeof (popup_tasks_items[0]); i++) + menus = g_slist_prepend (menus, &popup_tasks_items[i]); + } else if ( kind == ICAL_VEVENT_COMPONENT) { + for (i = 0; i < sizeof (popup_calendar_items) / sizeof (popup_calendar_items[0]); i++) + menus = g_slist_prepend (menus, &popup_calendar_items[i]); + } - e_popup_add_items (t->target.popup, menus, NULL, popup_free, t); + e_popup_add_items (t->target.popup, menus, NULL, popup_free, t); + } } void org_gnome_evolution_import_ics_part (EPlugin*ep, EMPopupTargetPart *t) -- cgit v1.2.3