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

svn path=/trunk/; revision=33030
This commit is contained in:
Parthasarathi Susarla
2006-11-28 18:26:29 +00:00
committed by Parthasarathi Susarla
parent be47ead6e1
commit b4300c6748
2 changed files with 23 additions and 10 deletions

View File

@ -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

View File

@ -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)