aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar.c
diff options
context:
space:
mode:
authorRussell Steinthal <rms39@columbia.edu>2000-02-16 22:27:38 +0800
committerSeth Alves <alves@src.gnome.org>2000-02-16 22:27:38 +0800
commit08f2b4e43ff25f5be620bfb3a3e3786b57849ad5 (patch)
treec0bf25e53209065c401325d27580982ac30c6e87 /calendar/gui/calendar.c
parentf926f10e86aee8df632613d9c5b5022e6b8597ca (diff)
downloadgsoc2013-evolution-08f2b4e43ff25f5be620bfb3a3e3786b57849ad5.tar
gsoc2013-evolution-08f2b4e43ff25f5be620bfb3a3e3786b57849ad5.tar.gz
gsoc2013-evolution-08f2b4e43ff25f5be620bfb3a3e3786b57849ad5.tar.bz2
gsoc2013-evolution-08f2b4e43ff25f5be620bfb3a3e3786b57849ad5.tar.lz
gsoc2013-evolution-08f2b4e43ff25f5be620bfb3a3e3786b57849ad5.tar.xz
gsoc2013-evolution-08f2b4e43ff25f5be620bfb3a3e3786b57849ad5.tar.zst
gsoc2013-evolution-08f2b4e43ff25f5be620bfb3a3e3786b57849ad5.zip
Change iCalObject.organizer from char* to iCalPerson*
2000-02-16 Russell Steinthal <rms39@columbia.edu> * calobj.[ch], eventedit.c, main.c: Change iCalObject.organizer from char* to iCalPerson* * calobj.[ch]: Change iCalObject.related from list of char* to list of iCalRelation*; assorted related fixes * icalendar.c: interface between libical and the gnomecal internal representation svn path=/trunk/; revision=1791
Diffstat (limited to 'calendar/gui/calendar.c')
-rw-r--r--calendar/gui/calendar.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/calendar/gui/calendar.c b/calendar/gui/calendar.c
index db31ba016b..0a690f344b 100644
--- a/calendar/gui/calendar.c
+++ b/calendar/gui/calendar.c
@@ -40,6 +40,10 @@ calendar_new (char *title,CalendarNewOptions options)
cal = g_new0 (Calendar, 1);
cal->title = g_strdup (title);
+ if (options & CALENDAR_USE_ICAL)
+ cal->format = CAL_ICAL;
+ else
+ cal->format = CAL_VCAL;
if ((calendar_day_begin == 0) || (calendar_day_end == 0))
calendar_set_day ();
@@ -315,18 +319,31 @@ calendar_load (Calendar *cal, char *fname)
}
cal->filename = g_strdup (fname);
- vcal = Parse_MIME_FromFileName (fname);
- if (!vcal)
- return "Could not load the calendar";
stat (fname, &s);
cal->file_time = s.st_mtime;
calendar_set_day ();
-
- calendar_load_from_vobject (cal, vcal);
- cleanVObject (vcal);
- cleanStrTbl ();
+
+ switch (cal->format) {
+ case CAL_VCAL:
+ vcal = Parse_MIME_FromFileName (fname);
+ if (!vcal)
+ return "Could not load the calendar";
+ calendar_load_from_vobject (cal, vcal);
+ cleanVObject (vcal);
+ cleanStrTbl ();
+ break;
+#ifdef HAVE_LIBICAL
+ hi;
+ case CAL_ICAL:
+ icalendar_calendar_load (cal, fname);
+ break;
+#endif
+ default:
+ return "Unknown calendar format";
+ }
+
return NULL;
}