aboutsummaryrefslogtreecommitdiff
path: root/src/datetime-prefs-locations.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-05-17 15:29:04 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-05-17 15:29:04 -0500
commitfa15f08c01e6350437dbb7023b8947eb12ab4e30 (patch)
treea286df2266343a437bebb74af4ecc686e081b972 /src/datetime-prefs-locations.c
parentbb897860e0a72f3dd0fa5bef86832b725e448712 (diff)
downloadayatana-indicator-datetime-fa15f08c01e6350437dbb7023b8947eb12ab4e30.tar.gz
ayatana-indicator-datetime-fa15f08c01e6350437dbb7023b8947eb12ab4e30.tar.bz2
ayatana-indicator-datetime-fa15f08c01e6350437dbb7023b8947eb12ab4e30.zip
fix a bug that caused the location settings to re-saved every time update_times() was called (which is periodically every 2 seconds).
Diffstat (limited to 'src/datetime-prefs-locations.c')
-rw-r--r--src/datetime-prefs-locations.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/datetime-prefs-locations.c b/src/datetime-prefs-locations.c
index 9f5b42c..0f21a5e 100644
--- a/src/datetime-prefs-locations.c
+++ b/src/datetime-prefs-locations.c
@@ -298,9 +298,13 @@ update_times (GtkWidget * dlg)
GDateTime * now_tz = g_date_time_to_timezone (now, tz);
gchar * format = generate_format_string_at_time (now_tz);
gchar * time_str = g_date_time_format (now_tz, format);
+ gchar * old_time_str;
- gtk_list_store_set (store, &iter, COL_TIME, time_str, -1);
+ gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, COL_TIME, &old_time_str, -1);
+ if (g_strcmp0 (old_time_str, time_str))
+ gtk_list_store_set (store, &iter, COL_TIME, time_str, -1);
+ g_free (old_time_str);
g_free (time_str);
g_free (format);
g_date_time_unref (now_tz);