aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2001-10-24 05:36:35 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-10-24 05:36:35 +0800
commit1451bdffda8a87d6053519ab868ff778d7fb0e01 (patch)
tree429ee52ed2d6873ab5c3a43226997cf25ecdabba
parent1bf22141608121ef5d1b9f9d354b14068999fc8a (diff)
downloadgsoc2013-evolution-1451bdffda8a87d6053519ab868ff778d7fb0e01.tar
gsoc2013-evolution-1451bdffda8a87d6053519ab868ff778d7fb0e01.tar.gz
gsoc2013-evolution-1451bdffda8a87d6053519ab868ff778d7fb0e01.tar.bz2
gsoc2013-evolution-1451bdffda8a87d6053519ab868ff778d7fb0e01.tar.lz
gsoc2013-evolution-1451bdffda8a87d6053519ab868ff778d7fb0e01.tar.xz
gsoc2013-evolution-1451bdffda8a87d6053519ab868ff778d7fb0e01.tar.zst
gsoc2013-evolution-1451bdffda8a87d6053519ab868ff778d7fb0e01.zip
make sure we free all the CalComponentDateTime's when we are finished.
2001-10-23 Damon Chaplin <damon@ximian.com> * cal-util/cal-component.c (cal_component_event_dates_match): make sure we free all the CalComponentDateTime's when we are finished. * gui/gnome-cal.c (gnome_calendar_notify_dates_shown_changed): just return if no time range is set. svn path=/trunk/; revision=13957
-rw-r--r--calendar/ChangeLog8
-rw-r--r--calendar/cal-util/cal-component.c45
-rw-r--r--calendar/gui/gnome-cal.c5
3 files changed, 44 insertions, 14 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index a1fa1eec38..30b5fc4e11 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,11 @@
+2001-10-23 Damon Chaplin <damon@ximian.com>
+
+ * cal-util/cal-component.c (cal_component_event_dates_match): make sure
+ we free all the CalComponentDateTime's when we are finished.
+
+ * gui/gnome-cal.c (gnome_calendar_notify_dates_shown_changed): just
+ return if no time range is set.
+
2001-10-23 JP Rosevear <jpr@ximian.com>
* gui/e-meeting-time-sel.c
diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c
index fb7c30f95b..58e1d4a945 100644
--- a/calendar/cal-util/cal-component.c
+++ b/calendar/cal-util/cal-component.c
@@ -4991,6 +4991,7 @@ cal_component_event_dates_match (CalComponent *comp1,
{
CalComponentDateTime comp1_dtstart, comp1_dtend;
CalComponentDateTime comp2_dtstart, comp2_dtend;
+ gboolean retval = TRUE;
cal_component_get_dtstart (comp1, &comp1_dtstart);
cal_component_get_dtend (comp1, &comp1_dtend);
@@ -4999,32 +5000,50 @@ cal_component_event_dates_match (CalComponent *comp1,
/* If either value is NULL they must both be NULL to match. */
if (comp1_dtstart.value == NULL || comp2_dtstart.value == NULL) {
- if (comp1_dtstart.value != comp2_dtstart.value)
- return FALSE;
+ if (comp1_dtstart.value != comp2_dtstart.value) {
+ retval = FALSE;
+ goto out;
+ }
} else {
if (icaltime_compare (*comp1_dtstart.value,
- *comp2_dtstart.value))
- return FALSE;
+ *comp2_dtstart.value)) {
+ retval = FALSE;
+ goto out;
+ }
}
if (comp1_dtend.value == NULL || comp2_dtend.value == NULL) {
- if (comp1_dtend.value != comp2_dtend.value)
- return FALSE;
+ if (comp1_dtend.value != comp2_dtend.value) {
+ retval = FALSE;
+ goto out;
+ }
} else {
if (icaltime_compare (*comp1_dtend.value,
- *comp2_dtend.value))
- return FALSE;
+ *comp2_dtend.value)) {
+ retval = FALSE;
+ goto out;
+ }
}
/* Now check the timezones. */
if (!cal_component_strings_match (comp1_dtstart.tzid,
- comp2_dtstart.tzid))
- return FALSE;
+ comp2_dtstart.tzid)) {
+ retval = FALSE;
+ goto out;
+ }
if (!cal_component_strings_match (comp1_dtend.tzid,
- comp2_dtend.tzid))
- return FALSE;
+ comp2_dtend.tzid)) {
+ retval = FALSE;
+ }
- return TRUE;
+ out:
+
+ cal_component_free_datetime (&comp1_dtstart);
+ cal_component_free_datetime (&comp1_dtend);
+ cal_component_free_datetime (&comp2_dtstart);
+ cal_component_free_datetime (&comp2_dtend);
+
+ return retval;
}
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 1790739853..28556ba522 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -2554,7 +2554,10 @@ gnome_calendar_notify_dates_shown_changed (GnomeCalendar *gcal)
priv = gcal->priv;
- gnome_calendar_get_visible_time_range (gcal, &start_time, &end_time);
+ /* If no time range is set yet, just return. */
+ if (!gnome_calendar_get_visible_time_range (gcal, &start_time,
+ &end_time))
+ return;
/* We check if the visible date range has changed, and only emit the
signal if it has. (This makes sure we only change the folder title