From cf4dbf9ee3790b9cf5e146594fa851757cd89881 Mon Sep 17 00:00:00 2001 From: Damon Chaplin Date: Tue, 30 Oct 2001 01:37:52 +0000 Subject: ref the ECalendarItem and check if it gets destroyed, to try to avoid a 2001-10-29 Damon Chaplin * e-calendar-item.c (e_calendar_item_signal_emission_idle_cb): ref the ECalendarItem and check if it gets destroyed, to try to avoid a free memory write. * e-dateedit.c (e_date_edit_set_time_of_day): allow setting the time to empty by passing hour as -1. svn path=/trunk/; revision=14394 --- widgets/misc/e-dateedit.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'widgets/misc/e-dateedit.c') diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index c0456c6437..fc3ac67407 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -758,7 +758,7 @@ e_date_edit_get_time_of_day (EDateEdit *dedit, /** * e_date_edit_set_time_of_day: * @dedit: an #EDateEdit widget. - * @hour: the hour to set. + * @hour: the hour to set, or -1 to set the time to None (i.e. empty). * @minute: the minute to set. * * Description: Sets the time in the time field. @@ -775,9 +775,15 @@ e_date_edit_set_time_of_day (EDateEdit *dedit, priv = dedit->priv; - if (priv->time_set_to_none - || priv->hour != hour - || priv->minute != minute) { + if (hour == -1) { + gboolean allow_no_date_set = e_date_edit_get_allow_no_date_set (dedit); + g_return_if_fail (allow_no_date_set); + if (!priv->time_set_to_none) { + priv->time_set_to_none = TRUE; + } + } else if (priv->time_set_to_none + || priv->hour != hour + || priv->minute != minute) { priv->time_set_to_none = FALSE; priv->hour = hour; priv->minute = minute; -- cgit v1.2.3