aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/calendar.c
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>1998-04-18 03:35:43 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-18 03:35:43 +0800
commit55f88f14fed53f67e4b3cd5337cbe92aee0ec638 (patch)
treed783e0896a0649b70ec67c13073841c7f3fbd64f /calendar/calendar.c
parentad0347d16bfd10f5f6b0783d7030cac420c4362a (diff)
downloadgsoc2013-evolution-55f88f14fed53f67e4b3cd5337cbe92aee0ec638.tar
gsoc2013-evolution-55f88f14fed53f67e4b3cd5337cbe92aee0ec638.tar.gz
gsoc2013-evolution-55f88f14fed53f67e4b3cd5337cbe92aee0ec638.tar.bz2
gsoc2013-evolution-55f88f14fed53f67e4b3cd5337cbe92aee0ec638.tar.lz
gsoc2013-evolution-55f88f14fed53f67e4b3cd5337cbe92aee0ec638.tar.xz
gsoc2013-evolution-55f88f14fed53f67e4b3cd5337cbe92aee0ec638.tar.zst
gsoc2013-evolution-55f88f14fed53f67e4b3cd5337cbe92aee0ec638.zip
Large number of updates. Recurrence basically works now in most of its
Large number of updates. Recurrence basically works now in most of its forms (daily, weekly, month-by-position). Miguel. svn path=/trunk/; revision=148
Diffstat (limited to 'calendar/calendar.c')
-rw-r--r--calendar/calendar.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/calendar/calendar.c b/calendar/calendar.c
index 7b5f50c46f..641d6d765e 100644
--- a/calendar/calendar.c
+++ b/calendar/calendar.c
@@ -207,21 +207,25 @@ calendar_load_from_vobject (Calendar *cal, VObject *vcal)
}
/* Loads a calendar from a file */
-void
+char *
calendar_load (Calendar *cal, char *fname)
{
VObject *vcal;
if (cal->filename){
g_warning ("Calendar load called again\n");
- return;
+ return "Internal error";
}
cal->filename = g_strdup (fname);
vcal = Parse_MIME_FromFileName (fname);
+ if (!vcal)
+ return "Could not load the calendar";
+
calendar_load_from_vobject (cal, vcal);
cleanVObject (vcal);
cleanStrTbl ();
+ return NULL;
}
void
@@ -250,7 +254,7 @@ calendar_save (Calendar *cal, char *fname)
cleanStrTbl ();
}
-static void
+static gint
calendar_object_compare_by_start (gpointer a, gpointer b)
{
CalendarObject *ca = a;
@@ -261,7 +265,7 @@ calendar_object_compare_by_start (gpointer a, gpointer b)
return (diff < 0) ? -1 : (diff > 0) ? 1 : 0;
}
-static void
+static int
assemble_event_list (iCalObject *obj, time_t start, time_t end, void *c)
{
CalendarObject *co;
@@ -272,6 +276,8 @@ assemble_event_list (iCalObject *obj, time_t start, time_t end, void *c)
co->ev_end = end;
co->ico = obj;
*l = g_list_insert_sorted (*l, co, calendar_object_compare_by_start);
+
+ return 1;
}
void
@@ -280,7 +286,7 @@ calendar_destroy_event_list (GList *l)
GList *p;
for (p = l; p; p = p->next)
- g_free (l->data);
+ g_free (p->data);
g_list_free (l);
}