From 72f23220db542cb8e41e9492528e79082c916804 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 17 Jun 2013 09:06:02 -0500 Subject: 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 --- src/utils.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/utils.c') 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); } -- cgit v1.2.3