aboutsummaryrefslogtreecommitdiff
path: root/src/datetime-prefs-locations.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-09-08 20:17:44 +0000
committerTarmac <Unknown>2013-09-08 20:17:44 +0000
commitb7f625ed8003197cd9d0a81240aea944860c8dc3 (patch)
treed94fd355f855c179072831004f8e3ae17b7b87d1 /src/datetime-prefs-locations.c
parent0896192c82c10144c184f274943ed692599d7529 (diff)
parente2096aa3f7d1a78ad0a8968a29529a6609a6fd5a (diff)
downloadayatana-indicator-datetime-b7f625ed8003197cd9d0a81240aea944860c8dc3.tar.gz
ayatana-indicator-datetime-b7f625ed8003197cd9d0a81240aea944860c8dc3.tar.bz2
ayatana-indicator-datetime-b7f625ed8003197cd9d0a81240aea944860c8dc3.zip
This change adds a GSettings* arg to the utils functions so that they don't have to churn through temporary GSettings objects.
These functions are usually called in a loop, causing a lot of GSettings temporaries, even though the calling code already has an instance for that GSettings schema. Approved by Ted Gould, PS Jenkins bot.
Diffstat (limited to 'src/datetime-prefs-locations.c')
-rw-r--r--src/datetime-prefs-locations.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/datetime-prefs-locations.c b/src/datetime-prefs-locations.c
index bc044a2..ca3d9b5 100644
--- a/src/datetime-prefs-locations.c
+++ b/src/datetime-prefs-locations.c
@@ -417,6 +417,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 +429,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 +448,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;