aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/utils.c b/src/utils.c
index f5aecd6..fa54008 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -117,30 +117,6 @@ get_current_zone_name (const gchar * location)
return rv;
}
-gchar *
-read_timezone ()
-{
- GError * error = NULL;
- gchar * tempzone = NULL;
- if (!g_file_get_contents(TIMEZONE_FILE, &tempzone, NULL, &error)) {
- g_warning("Unable to read timezone file '" TIMEZONE_FILE "': %s", error->message);
- g_error_free(error);
- return NULL;
- }
-
- /* This shouldn't happen, so let's make it a big boom! */
- g_return_val_if_fail(tempzone != NULL, NULL);
-
- /* Note: this really makes sense as strstrip works in place
- so we end up with something a little odd without the dup
- so we have the dup to make sure everything is as expected
- for everyone else. */
- gchar * rv = g_strdup(g_strstrip(tempzone));
- g_free(tempzone);
-
- return rv;
-}
-
/* Translate msg according to the locale specified by LC_TIME */
static char *
T_(const char *msg)
@@ -250,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”)
@@ -260,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;
@@ -296,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);
}