diff options
author | Ted Gould <ted@gould.cx> | 2013-10-28 17:09:05 -0700 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2013-10-28 17:09:05 -0700 |
commit | 26283de417c1c3cb3456f1a893fe339056517d56 (patch) | |
tree | b6851a0f12bbeae649854fb5a4a8a85a54d800f1 /src/datetime-prefs-locations.c | |
parent | 0fa8138427d8469eb2f6a90b0291dbdc4507c8fb (diff) | |
parent | 19ba64b479fd14d5192f0ec3dcc37fe33bde238b (diff) | |
download | ayatana-indicator-datetime-26283de417c1c3cb3456f1a893fe339056517d56.tar.gz ayatana-indicator-datetime-26283de417c1c3cb3456f1a893fe339056517d56.tar.bz2 ayatana-indicator-datetime-26283de417c1c3cb3456f1a893fe339056517d56.zip |
Merge trunk
Diffstat (limited to 'src/datetime-prefs-locations.c')
-rw-r--r-- | src/datetime-prefs-locations.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/datetime-prefs-locations.c b/src/datetime-prefs-locations.c index bc044a2..f953ec7 100644 --- a/src/datetime-prefs-locations.c +++ b/src/datetime-prefs-locations.c @@ -96,7 +96,9 @@ time_location_array_new_from_model (GtkTreeModel * model) COL_ZONE, &zone, COL_VISIBLE_NAME, &name, -1); - list = g_slist_prepend (list, time_location_new (zone, name, pos++, now)); + + if (zone && name) + list = g_slist_prepend (list, time_location_new (zone, name, pos++, now)); g_free (name); g_free (zone); @@ -417,6 +419,7 @@ update_times (GtkWidget * dlg) g_signal_handlers_block_by_func (store, save_when_idle, dlg); + GSettings * settings = g_settings_new (SETTINGS_INTERFACE); GtkTreeIter iter; if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter)) { GDateTime * now = g_date_time_new_now_local (); @@ -428,7 +431,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_full_format_string_at_time (now, now_tz); + gchar * format = generate_full_format_string_at_time (now, now_tz, settings); gchar * time_str = g_date_time_format (now_tz, format); gchar * old_time_str; @@ -447,6 +450,8 @@ update_times (GtkWidget * dlg) g_date_time_unref (now); } + g_object_unref (settings); + g_signal_handlers_unblock_by_func (store, save_when_idle, dlg); return TRUE; |