diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-06-17 11:09:43 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2013-06-17 11:09:43 -0500 |
commit | 32915975083819f39112f5c4c009b45a3e8ae33b (patch) | |
tree | 4a658b2b50bba099a2a0ac6a2d3dce32077e5446 | |
parent | 03485394759c46169b89cc42e513fde19b5dcd51 (diff) | |
download | ayatana-ido-32915975083819f39112f5c4c009b45a3e8ae33b.tar.gz ayatana-ido-32915975083819f39112f5c4c009b45a3e8ae33b.tar.bz2 ayatana-ido-32915975083819f39112f5c4c009b45a3e8ae33b.zip |
in IdoAppointmentMenuItem's update_timestamp_label(), clear the label text if either the time or format properties are unset
-rw-r--r-- | src/idoappointmentmenuitem.c | 13 |
1 files changed, 8 insertions, 5 deletions
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); } /*** |