diff options
-rw-r--r-- | calendar/ChangeLog | 12 | ||||
-rw-r--r-- | calendar/calendar.c | 4 | ||||
-rw-r--r-- | calendar/gui/calendar.c | 4 | ||||
-rw-r--r-- | calendar/gui/main.c | 8 | ||||
-rw-r--r-- | calendar/main.c | 8 |
5 files changed, 32 insertions, 4 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index c3413eefbf..d6e07deabd 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,15 @@ +1999-08-30 Miguel de Icaza <miguel@nuclecu.unam.mx> + + * calendar.c (calendar_object_changed): Modify the + object->last_mod field. + (calendar_add_object): Ditto. + + Closes bug #676 + + * main.c (save_calendar_cmd): Fix problem in which we warned the + user about the calendar being modified the first time the calendar + was used. + 1999-08-22 Tomas Ogren <stric@ing.umu.se> * gnomecal.gnorba: "GenericFactoy" is wrong... diff --git a/calendar/calendar.c b/calendar/calendar.c index dfeb1d6cc8..e6c6dddf59 100644 --- a/calendar/calendar.c +++ b/calendar/calendar.c @@ -133,7 +133,7 @@ calendar_add_object (Calendar *cal, iCalObject *obj) cal->modified = TRUE; - /* FIXME: do we have to set the last_mod field in the object? */ + obj->last_mod = time (NULL); } void @@ -504,6 +504,8 @@ calendar_get_events_in_range (Calendar *cal, time_t start, time_t end) void calendar_object_changed (Calendar *cal, iCalObject *obj, int flags) { + obj->last_mod = time (NULL); + if (!(flags & CHANGE_DATES)) return; diff --git a/calendar/gui/calendar.c b/calendar/gui/calendar.c index dfeb1d6cc8..e6c6dddf59 100644 --- a/calendar/gui/calendar.c +++ b/calendar/gui/calendar.c @@ -133,7 +133,7 @@ calendar_add_object (Calendar *cal, iCalObject *obj) cal->modified = TRUE; - /* FIXME: do we have to set the last_mod field in the object? */ + obj->last_mod = time (NULL); } void @@ -504,6 +504,8 @@ calendar_get_events_in_range (Calendar *cal, time_t start, time_t end) void calendar_object_changed (Calendar *cal, iCalObject *obj, int flags) { + obj->last_mod = time (NULL); + if (!(flags & CHANGE_DATES)) return; diff --git a/calendar/gui/main.c b/calendar/gui/main.c index 6c4a4b4522..1cd65f331e 100644 --- a/calendar/gui/main.c +++ b/calendar/gui/main.c @@ -15,6 +15,7 @@ #include <sys/stat.h> #include <string.h> #include <ctype.h> +#include <errno.h> #include "calendar.h" #include "alarm.h" #include "eventedit.h" @@ -422,7 +423,12 @@ save_calendar_cmd (GtkWidget *widget, void *data) if (gcal->cal->filename){ struct stat s; - stat (gcal->cal->filename, &s); + if (stat (gcal->cal->filename, &s) == -1){ + if (errno == ENOENT) + calendar_save (gcal->cal, gcal->cal->filename); + + return; + } if (s.st_mtime != gcal->cal->file_time){ GtkWidget *box; diff --git a/calendar/main.c b/calendar/main.c index 6c4a4b4522..1cd65f331e 100644 --- a/calendar/main.c +++ b/calendar/main.c @@ -15,6 +15,7 @@ #include <sys/stat.h> #include <string.h> #include <ctype.h> +#include <errno.h> #include "calendar.h" #include "alarm.h" #include "eventedit.h" @@ -422,7 +423,12 @@ save_calendar_cmd (GtkWidget *widget, void *data) if (gcal->cal->filename){ struct stat s; - stat (gcal->cal->filename, &s); + if (stat (gcal->cal->filename, &s) == -1){ + if (errno == ENOENT) + calendar_save (gcal->cal, gcal->cal->filename); + + return; + } if (s.st_mtime != gcal->cal->file_time){ GtkWidget *box; |