aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-06-17 09:06:02 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-06-17 09:06:02 -0500
commit72f23220db542cb8e41e9492528e79082c916804 (patch)
tree0ec9b3df80e55a3686d06bd9595c77a4a008f41f /src/utils.c
parent49ee32fefe869a778f39f88a936f546ef2c68737 (diff)
downloadayatana-indicator-datetime-72f23220db542cb8e41e9492528e79082c916804.tar.gz
ayatana-indicator-datetime-72f23220db542cb8e41e9492528e79082c916804.tar.bz2
ayatana-indicator-datetime-72f23220db542cb8e41e9492528e79082c916804.zip
in service.c, replace all calls to time(NULL) and g_date_time_new_now_local() with a call to the new 'indicator_datetime_service_get_localtime()' func. This is currently a passthrough to _new_now_local(), but we'll need this control point to override the system time in unit testing
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/utils.c b/src/utils.c
index 07a2022..fa54008 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -226,7 +226,7 @@ generate_format_string_full (gboolean show_day, gboolean show_date)
}
gchar *
-generate_format_string_at_time (GDateTime * time)
+generate_format_string_at_time (GDateTime * now, GDateTime * time)
{
/* This is a bit less free-form than for the main "now" time label. */
/* If it is today, just the time should be shown (e.g. “3:55 PM”)
@@ -236,8 +236,6 @@ generate_format_string_at_time (GDateTime * time)
gboolean show_day = FALSE;
gboolean show_date = FALSE;
- GDateTime * now = g_date_time_new_now_local();
-
/* First, are we same day? */
gint time_year, time_month, time_day;
gint now_year, now_month, now_day;
@@ -272,8 +270,6 @@ generate_format_string_at_time (GDateTime * time)
g_date_time_unref(future_bound);
}
- g_date_time_unref (now);
-
return generate_format_string_full(show_day, show_date);
}