aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorEskil Heyn Olsen <eskil@src.gnome.org>1999-12-31 23:58:08 +0800
committerEskil Heyn Olsen <eskil@src.gnome.org>1999-12-31 23:58:08 +0800
commiteb7c5ae3c5fa9ab3bab2a60d7a0c8a5a4ed93cb7 (patch)
treebc250c8cc8679635d972d3f847291882f02bc062 /calendar/gui
parent0948bfda86d63a09c5b5c9661911e963cc750357 (diff)
downloadgsoc2013-evolution-eb7c5ae3c5fa9ab3bab2a60d7a0c8a5a4ed93cb7.tar
gsoc2013-evolution-eb7c5ae3c5fa9ab3bab2a60d7a0c8a5a4ed93cb7.tar.gz
gsoc2013-evolution-eb7c5ae3c5fa9ab3bab2a60d7a0c8a5a4ed93cb7.tar.bz2
gsoc2013-evolution-eb7c5ae3c5fa9ab3bab2a60d7a0c8a5a4ed93cb7.tar.lz
gsoc2013-evolution-eb7c5ae3c5fa9ab3bab2a60d7a0c8a5a4ed93cb7.tar.xz
gsoc2013-evolution-eb7c5ae3c5fa9ab3bab2a60d7a0c8a5a4ed93cb7.tar.zst
gsoc2013-evolution-eb7c5ae3c5fa9ab3bab2a60d7a0c8a5a4ed93cb7.zip
Committed fixes for the end-on-day recurrence bug where the last
day was skipped. Also fixed problem with multiple setitimer calls that where especially pesky in the corba part, where corba calls would cause numerous alarm dialogs when the events alarm went off. svn path=/trunk/; revision=1525
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/calendar-pilot-sync.c2
-rw-r--r--calendar/gui/calendar.c8
-rw-r--r--calendar/gui/calendar.h7
-rw-r--r--calendar/gui/corba-cal.c2
-rw-r--r--calendar/gui/eventedit.c11
-rw-r--r--calendar/gui/gnome-cal.c2
-rw-r--r--calendar/gui/main.c4
7 files changed, 23 insertions, 13 deletions
diff --git a/calendar/gui/calendar-pilot-sync.c b/calendar/gui/calendar-pilot-sync.c
index a98ff9b49b..5039bb37b7 100644
--- a/calendar/gui/calendar-pilot-sync.c
+++ b/calendar/gui/calendar-pilot-sync.c
@@ -605,7 +605,7 @@ sync_pilot (GNOME_Calendar_Repository repo, int pilot_fd)
*/
if (!only_pilot_to_desktop){
vcalendar_string = GNOME_Calendar_Repository_get_updated_objects (repo, &ev);
- dirty_cal = calendar_new ("Temporal");
+ dirty_cal = calendar_new ("Temporal",CALENDAR_INIT_NIL);
error = calendar_load_from_memory (dirty_cal, vcalendar_string);
if (!error)
sync_cal_to_pilot (repo, dirty_cal, pilot_fd);
diff --git a/calendar/gui/calendar.c b/calendar/gui/calendar.c
index 0fbecaf6f6..db31ba016b 100644
--- a/calendar/gui/calendar.c
+++ b/calendar/gui/calendar.c
@@ -33,7 +33,7 @@ static void calendar_init_alarms (Calendar *cal);
static void calendar_set_day (void);
Calendar *
-calendar_new (char *title)
+calendar_new (char *title,CalendarNewOptions options)
{
Calendar *cal;
@@ -46,7 +46,9 @@ calendar_new (char *title)
cal->event_hash = g_hash_table_new (g_str_hash, g_str_equal);
- calendar_init_alarms (cal);
+ if (options & CALENDAR_INIT_ALARMS) {
+ calendar_init_alarms (cal);
+ }
return cal;
}
@@ -633,7 +635,7 @@ calendar_string_from_object (iCalObject *object)
g_return_val_if_fail (object != NULL, NULL);
- cal = calendar_new ("Temporal");
+ cal = calendar_new ("Temporal",CALENDAR_INIT_NIL);
calendar_add_object (cal, object);
str = calendar_get_as_vcal_string (cal);
calendar_remove_object (cal, object);
diff --git a/calendar/gui/calendar.h b/calendar/gui/calendar.h
index 4a9d4bcff2..858f0151ca 100644
--- a/calendar/gui/calendar.h
+++ b/calendar/gui/calendar.h
@@ -41,7 +41,12 @@ typedef struct {
iCalObject *ico;
} CalendarObject;
-Calendar *calendar_new (char *title);
+typedef enum {
+ CALENDAR_INIT_NIL = 0,
+ CALENDAR_INIT_ALARMS = 1 << 0
+} CalendarNewOptions;
+
+Calendar *calendar_new (char *title,CalendarNewOptions options);
char *calendar_get_as_vcal_string (Calendar *cal);
char *calendar_string_from_object (iCalObject *object);
diff --git a/calendar/gui/corba-cal.c b/calendar/gui/corba-cal.c
index 472d83008e..2a3a727869 100644
--- a/calendar/gui/corba-cal.c
+++ b/calendar/gui/corba-cal.c
@@ -251,7 +251,7 @@ cal_repo_get_updated_objects (PortableServer_Servant servant,
CORBA_char *res;
char *str;
- dirty_cal = calendar_new ("Temporal");
+ dirty_cal = calendar_new ("Temporal",CALENDAR_INIT_NIL);
for (l = gcal->cal->events; l; l = l->next){
iCalObject *obj = l->data;
diff --git a/calendar/gui/eventedit.c b/calendar/gui/eventedit.c
index 5b45674d00..31fbf11225 100644
--- a/calendar/gui/eventedit.c
+++ b/calendar/gui/eventedit.c
@@ -650,7 +650,9 @@ ee_store_recur_end_to_ical (EventEditor *ee)
case 1:
/* end date */
- ical->recur->_enddate = gnome_date_edit_get_date (GNOME_DATE_EDIT (ee->recur_ed_end_on));
+ /* Also here, to ensure that the event is used, we add 86400 secs to get
+ get next day, in accordance to the RFC */
+ ical->recur->_enddate = gnome_date_edit_get_date (GNOME_DATE_EDIT (ee->recur_ed_end_on)) + 86400;
ical->recur->enddate = ical->recur->_enddate;
ical->recur->duration = 0;
break;
@@ -1247,9 +1249,10 @@ ee_rp_init_ending_date (EventEditor *ee)
gtk_widget_set_sensitive (ihbox, FALSE);
gtk_box_pack_start (GTK_BOX (hbox), ihbox, FALSE, FALSE, 0);
- if (ee->ical->recur)
- enddate = ee->ical->recur->enddate;
- else
+ if (ee->ical->recur) {
+ /* Shorten by one day, as we store end-on date a day ahead */
+ enddate = ee->ical->recur->enddate - 86400;
+ } else
enddate = ee->ical->dtend;
ee->recur_ed_end_on = widget = date_edit_new (enddate, FALSE);
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 9b3479e473..387d46a31c 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -227,7 +227,7 @@ gnome_calendar_new (char *title)
gtk_window_set_title(GTK_WINDOW(retval), title);
gcal->current_display = time_day_begin (time (NULL));
- gcal->cal = calendar_new (title);
+ gcal->cal = calendar_new (title,CALENDAR_INIT_ALARMS);
setup_widgets (gcal);
gnome_calendar_create_corba_server (gcal);
diff --git a/calendar/gui/main.c b/calendar/gui/main.c
index 98157d101d..9dead6b92e 100644
--- a/calendar/gui/main.c
+++ b/calendar/gui/main.c
@@ -788,7 +788,7 @@ dump_events (void)
process_dates ();
init_calendar ();
- cal = calendar_new (full_name);
+ cal = calendar_new (full_name, CALENDAR_INIT_ALARMS);
s = calendar_load (cal, load_file ? load_file : user_calendar_file);
if (s){
printf ("error: %s\n", s);
@@ -832,7 +832,7 @@ dump_todo (void)
process_dates ();
init_calendar ();
- cal = calendar_new (full_name);
+ cal = calendar_new (full_name, CALENDAR_INIT_ALARMS);
s = calendar_load (cal, load_file ? load_file : user_calendar_file);
if (s){
printf ("error: %s\n", s);