aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-07-16 16:52:21 -0500
committerTed Gould <ted@gould.cx>2010-07-16 16:52:21 -0500
commit2dd110402933ffb4d3ce5ea76540c4af44522188 (patch)
treef2bfd6618a42cb3e35726114a448809769d8425e /src
parent7f0199e5ada294c7e3d2cb972d1158ed59ae38b1 (diff)
downloadayatana-indicator-datetime-2dd110402933ffb4d3ce5ea76540c4af44522188.tar.gz
ayatana-indicator-datetime-2dd110402933ffb4d3ce5ea76540c4af44522188.tar.bz2
ayatana-indicator-datetime-2dd110402933ffb4d3ce5ea76540c4af44522188.zip
Making it so that update_label can return struct tm
Diffstat (limited to 'src')
-rw-r--r--src/indicator-datetime.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c
index 7a6f941..b7b8a2d 100644
--- a/src/indicator-datetime.c
+++ b/src/indicator-datetime.c
@@ -132,7 +132,7 @@ static GtkMenu * get_menu (IndicatorObject * io);
static GVariant * bind_enum_set (const GValue * value, const GVariantType * type, gpointer user_data);
static gboolean bind_enum_get (GValue * value, GVariant * variant, gpointer user_data);
static gchar * generate_format_string (IndicatorDatetime * self);
-static void update_label (IndicatorDatetime * io);
+static struct tm * update_label (IndicatorDatetime * io);
static void guess_label_size (IndicatorDatetime * self);
static void setup_timer (IndicatorDatetime * self, struct tm * ltime);
@@ -502,12 +502,12 @@ idle_measure (gpointer data)
}
/* Updates the label to be the current time. */
-static void
+static struct tm *
update_label (IndicatorDatetime * io)
{
IndicatorDatetime * self = INDICATOR_DATETIME(io);
- if (self->priv->label == NULL) return;
+ if (self->priv->label == NULL) return NULL;
gchar longstr[128];
time_t t;
@@ -518,7 +518,7 @@ update_label (IndicatorDatetime * io)
if (ltime == NULL) {
g_debug("Error getting local time");
gtk_label_set_label(self->priv->label, _("Error getting time"));
- return;
+ return NULL;
}
strftime(longstr, 128, self->priv->time_string, ltime);
@@ -531,7 +531,7 @@ update_label (IndicatorDatetime * io)
self->priv->idle_measure = g_idle_add(idle_measure, io);
}
- return;
+ return ltime;
}
/* Runs every minute and updates the time */