aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
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/gui
parentbacbb085895ae69e7f443cc39e04b686128a63a3 (diff)
downloadgsoc2013-evolution-c050cb45aa1eb2af7b53451334a4b979b27c5214.tar
gsoc2013-evolution-c050cb45aa1eb2af7b53451334a4b979b27c5214.tar.gz
gsoc2013-evolution-c050cb45aa1eb2af7b53451334a4b979b27c5214.tar.bz2
gsoc2013-evolution-c050cb45aa1eb2af7b53451334a4b979b27c5214.tar.lz
gsoc2013-evolution-c050cb45aa1eb2af7b53451334a4b979b27c5214.tar.xz
gsoc2013-evolution-c050cb45aa1eb2af7b53451334a4b979b27c5214.tar.zst
gsoc2013-evolution-c050cb45aa1eb2af7b53451334a4b979b27c5214.zip
lots more -mig
svn path=/trunk/; revision=105
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/calendar.c26
-rw-r--r--calendar/gui/calendar.h1
2 files changed, 27 insertions, 0 deletions
diff --git a/calendar/gui/calendar.c b/calendar/gui/calendar.c
index 482543b84b..efcb157e8b 100644
--- a/calendar/gui/calendar.c
+++ b/calendar/gui/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);
+}
+
diff --git a/calendar/gui/calendar.h b/calendar/gui/calendar.h
index 805076d949..f990caabd6 100644
--- a/calendar/gui/calendar.h
+++ b/calendar/gui/calendar.h
@@ -14,6 +14,7 @@ typedef struct {
time_t created;
int modified;
+ void *temp;
} Calendar;
Calendar *calendar_new (char *title);