aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/import-ics-attachments/ChangeLog8
-rw-r--r--plugins/import-ics-attachments/icsimporter.c25
2 files changed, 23 insertions, 10 deletions
diff --git a/plugins/import-ics-attachments/ChangeLog b/plugins/import-ics-attachments/ChangeLog
index fa9b3b820b..a6f2ee81f0 100644
--- a/plugins/import-ics-attachments/ChangeLog
+++ b/plugins/import-ics-attachments/ChangeLog
@@ -1,3 +1,11 @@
+2006-11-28 Parthasarathi Susarla <ajaysusarla@gmail.com>
+
+ ** 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
+
2006-08-28 Kjartan Maraas <kmaraas@gnome.org>
* org-gnome-evolution-mail-attachments-import-ics.eplug.xml: Mark
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)