aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2001-06-25 07:56:38 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2001-06-25 07:56:38 +0800
commit5a5ec44e5a7382cfccdb8ba6ed4673600e5c44ce (patch)
tree898bdb1ebe3d39d619ed1ef0324136e4f5e25009 /calendar/pcs
parentf08f4c88be0ffdf26639a5100e8ffb31bbb6668b (diff)
downloadgsoc2013-evolution-5a5ec44e5a7382cfccdb8ba6ed4673600e5c44ce.tar
gsoc2013-evolution-5a5ec44e5a7382cfccdb8ba6ed4673600e5c44ce.tar.gz
gsoc2013-evolution-5a5ec44e5a7382cfccdb8ba6ed4673600e5c44ce.tar.bz2
gsoc2013-evolution-5a5ec44e5a7382cfccdb8ba6ed4673600e5c44ce.tar.lz
gsoc2013-evolution-5a5ec44e5a7382cfccdb8ba6ed4673600e5c44ce.tar.xz
gsoc2013-evolution-5a5ec44e5a7382cfccdb8ba6ed4673600e5c44ce.tar.zst
gsoc2013-evolution-5a5ec44e5a7382cfccdb8ba6ed4673600e5c44ce.zip
Initialize libglade.
2001-06-24 Federico Mena Quintero <federico@ximian.com> * gui/alarm-notify/notify-main.c (main): Initialize libglade. * pcs/cal-backend-file.c (compute_alarm_range): icaldurationtype_as_int() will now return a negative value if dur->is_neg is true, so we need to flip the sign of some operations here. (add_alarm_occurrences_cb): Likewise. * pcs/cal-backend-db.c (compute_alarm_range): Likewise. (add_alarm_occurrences_cb): Likewise. svn path=/trunk/; revision=10456
Diffstat (limited to 'calendar/pcs')
-rw-r--r--calendar/pcs/cal-backend-db.c17
-rw-r--r--calendar/pcs/cal-backend-file.c17
2 files changed, 24 insertions, 10 deletions
diff --git a/calendar/pcs/cal-backend-db.c b/calendar/pcs/cal-backend-db.c
index 56b9786c0d..73aef5d054 100644
--- a/calendar/pcs/cal-backend-db.c
+++ b/calendar/pcs/cal-backend-db.c
@@ -998,7 +998,11 @@ compute_alarm_range (CalComponent *comp,
dur_time = icaldurationtype_as_int (*dur);
if (dur->is_neg)
- *alarm_end = MAX (*alarm_end, end + dur_time);
+ /* If the duration is negative then dur_time
+ * will be negative as well; that is why we
+ * subtract to expand the range.
+ */
+ *alarm_end = MAX (*alarm_end, end - dur_time);
else
*alarm_start = MIN (*alarm_start, start - dur_time);
@@ -1062,10 +1066,13 @@ add_alarm_occurrences_cb (CalComponent *comp, time_t start, time_t end, gpointer
else
occur_time = end;
- if (dur->is_neg)
- trigger_time = occur_time - dur_time;
- else
- trigger_time = occur_time + dur_time;
+ /* If dur->is_neg is true then dur_time will already be
+ * negative. So we do not need to test for dur->is_neg here; we
+ * can simply add the dur_time value to the occur_time and get
+ * the correct result.
+ */
+
+ trigger_time = occur_time + dur_time;
if (trigger_time < aod->start || trigger_time >= aod->end)
continue;
diff --git a/calendar/pcs/cal-backend-file.c b/calendar/pcs/cal-backend-file.c
index fdf7eefad1..b7ba095a30 100644
--- a/calendar/pcs/cal-backend-file.c
+++ b/calendar/pcs/cal-backend-file.c
@@ -1157,7 +1157,11 @@ compute_alarm_range (CalComponent *comp, GList *alarm_uids, time_t start, time_t
dur_time = icaldurationtype_as_int (*dur);
if (dur->is_neg)
- *alarm_end = MAX (*alarm_end, end + dur_time);
+ /* If the duration is negative then dur_time
+ * will be negative as well; that is why we
+ * subtract to expand the range.
+ */
+ *alarm_end = MAX (*alarm_end, end - dur_time);
else
*alarm_start = MIN (*alarm_start, start - dur_time);
@@ -1222,10 +1226,13 @@ add_alarm_occurrences_cb (CalComponent *comp, time_t start, time_t end, gpointer
else
occur_time = end;
- if (dur->is_neg)
- trigger_time = occur_time - dur_time;
- else
- trigger_time = occur_time + dur_time;
+ /* If dur->is_neg is true then dur_time will already be
+ * negative. So we do not need to test for dur->is_neg here; we
+ * can simply add the dur_time value to the occur_time and get
+ * the correct result.
+ */
+
+ trigger_time = occur_time + dur_time;
if (trigger_time < aod->start || trigger_time >= aod->end)
continue;