From 32915975083819f39112f5c4c009b45a3e8ae33b Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 17 Jun 2013 11:09:43 -0500 Subject: in IdoAppointmentMenuItem's update_timestamp_label(), clear the label text if either the time or format properties are unset --- src/idoappointmentmenuitem.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/idoappointmentmenuitem.c b/src/idoappointmentmenuitem.c index a24ab49..26029a7 100644 --- a/src/idoappointmentmenuitem.c +++ b/src/idoappointmentmenuitem.c @@ -236,6 +236,7 @@ ido_appointment_menu_item_init (IdoAppointmentMenuItem *self) **** ***/ +/* creates a menu-sized pixbuf filled with specified color */ static GdkPixbuf * create_color_icon_pixbuf (const char * color_spec) { @@ -280,14 +281,16 @@ create_color_icon_pixbuf (const char * color_spec) static void update_timestamp_label (IdoAppointmentMenuItem * self) { + char * str; priv_t * p = self->priv; if (p->date_time && p->format) - { - char * str = g_date_time_format (p->date_time, p->format); - gtk_label_set_text (GTK_LABEL(p->timestamp_label), str); - g_free (str); - } + str = g_date_time_format (p->date_time, p->format); + else + str = NULL; + + gtk_label_set_text (GTK_LABEL(p->timestamp_label), str); + g_free (str); } /*** -- cgit v1.2.3