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/datetime-prefs-locations.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/datetime-prefs-locations.c')
-rw-r--r-- | src/datetime-prefs-locations.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/datetime-prefs-locations.c b/src/datetime-prefs-locations.c index 33fd660..4bbf053 100644 --- a/src/datetime-prefs-locations.c +++ b/src/datetime-prefs-locations.c @@ -25,6 +25,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #endif #include <stdlib.h> +#include <time.h> /* time_t */ #include <glib/gi18n-lib.h> #include <gtk/gtk.h> #include <timezonemap/timezone-completion.h> @@ -416,10 +417,9 @@ update_times (GtkWidget * dlg) g_signal_handlers_block_by_func (store, save_when_idle, dlg); - GDateTime * now = g_date_time_new_now_local (); - GtkTreeIter iter; if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter)) { + GDateTime * now = g_date_time_new_now_local (); do { gchar * strzone; @@ -428,7 +428,7 @@ update_times (GtkWidget * dlg) if (strzone && *strzone) { GTimeZone * tz = g_time_zone_new (strzone); GDateTime * now_tz = g_date_time_to_timezone (now, tz); - gchar * format = generate_format_string_at_time (now_tz); + gchar * format = generate_format_string_at_time (now, now_tz); gchar * time_str = g_date_time_format (now_tz, format); gchar * old_time_str; @@ -444,10 +444,9 @@ update_times (GtkWidget * dlg) } g_free (strzone); } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter)); + g_date_time_unref (now); } - g_date_time_unref (now); - g_signal_handlers_unblock_by_func (store, save_when_idle, dlg); return TRUE; |