diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-06-21 15:01:54 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2013-06-21 15:01:54 +0000 |
commit | 854fb1a47bed41e41e6fed9c5e498dc81146302a (patch) | |
tree | c0db59a66b90162a7f8ae2519430249ce5a5ffb6 /src/utils.c | |
parent | 05ba6fa097260473c774d0d077d4e3add3db134b (diff) | |
parent | 51bd7465ac148a34ec37cb8760daf3b282b5ed6a (diff) | |
download | ayatana-indicator-datetime-854fb1a47bed41e41e6fed9c5e498dc81146302a.tar.gz ayatana-indicator-datetime-854fb1a47bed41e41e6fed9c5e498dc81146302a.tar.bz2 ayatana-indicator-datetime-854fb1a47bed41e41e6fed9c5e498dc81146302a.zip |
This push extracts geoclue to its own self-contained module, fixes an errant g_critical, and merges ryan's timedate1 changes from the 13.04 branch.
Approved by PS Jenkins bot, Lars Uebernickel.
Diffstat (limited to 'src/utils.c')
-rw-r--r-- | src/utils.c | 30 |
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); } |