aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/calendar.c
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>1998-04-04 11:43:48 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-04 11:43:48 +0800
commitc050cb45aa1eb2af7b53451334a4b979b27c5214 (patch)
tree6585e7ce32858b4473776d1d9472e7a977914996 /calendar/calendar.c
parentbacbb085895ae69e7f443cc39e04b686128a63a3 (diff)
downloadgsoc2013-evolution-c050cb45aa1eb2af7b53451334a4b979b27c5214.tar.gz
gsoc2013-evolution-c050cb45aa1eb2af7b53451334a4b979b27c5214.tar.zst
gsoc2013-evolution-c050cb45aa1eb2af7b53451334a4b979b27c5214.zip
lots more -mig
svn path=/trunk/; revision=105
Diffstat (limited to 'calendar/calendar.c')
-rw-r--r--calendar/calendar.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/calendar/calendar.c b/calendar/calendar.c
index 482543b84b..efcb157e8b 100644
--- a/calendar/calendar.c
+++ b/calendar/calendar.c
@@ -200,3 +200,29 @@ calendar_load (Calendar *cal, char *fname)
calendar_load_from_vobject (cal, vcal);
cleanVObject (vcal);
}
+
+void
+calendar_save (Calendar *cal, char *fname)
+{
+ VObject *vcal;
+ GList *l;
+
+ if (fname == NULL)
+ fname = cal->filename;
+
+ vcal = newVObject (VCCalProp);
+ addPropValue (vcal, VCProdIdProp, "-//GNOME//NONSGML GnomeCalendar//EN");
+ addPropValue (vcal, VCTimeZoneProp, "NONE");
+ addPropValue (vcal, VCVersionProp, VERSION);
+ cal->temp = vcal;
+
+ for (l = cal->events; l; l = l->next){
+ VObject *obj;
+
+ obj = ical_object_to_vobject ((iCalObject *) l->data);
+ addVObjectProp (vcal, obj);
+ }
+ writeVObjectToFile (fname, vcal);
+ cleanVObject (vcal);
+}
+