aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-06-17 11:09:43 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-06-17 11:09:43 -0500
commit32915975083819f39112f5c4c009b45a3e8ae33b (patch)
tree4a658b2b50bba099a2a0ac6a2d3dce32077e5446 /src
parent03485394759c46169b89cc42e513fde19b5dcd51 (diff)
downloadayatana-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
Diffstat (limited to 'src')
-rw-r--r--src/idoappointmentmenuitem.c13
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);
}
/***