diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-05-03 14:31:45 -0700 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2013-05-03 14:31:45 -0700 |
commit | ec7db5b53511247719434175951c2fb9daefd0f2 (patch) | |
tree | f26cc724f0ebd1da1a89fb4c5cdd68e380d5be0a | |
parent | ad4d799e778a7c31c4c10e77fac4053e71ac9a75 (diff) | |
download | ayatana-indicator-datetime-ec7db5b53511247719434175951c2fb9daefd0f2.tar.gz ayatana-indicator-datetime-ec7db5b53511247719434175951c2fb9daefd0f2.tar.bz2 ayatana-indicator-datetime-ec7db5b53511247719434175951c2fb9daefd0f2.zip |
make the flow in on_use_geoclue_changed_cb() a little easier to read
-rw-r--r-- | src/datetime-service.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c index 52d9647..ff22db5 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -1255,16 +1255,15 @@ on_use_geoclue_changed_cb (GSettings *settings, gchar *key G_GNUC_UNUSED, gpointer user_data G_GNUC_UNUSED) { - const gboolean using = geo_location != NULL; - const gboolean should_use = g_settings_get_boolean (conf, "show-auto-detected-location"); + const gboolean use_geoclue = g_settings_get_boolean (conf, "show-auto-detected-location"); - if (using && !should_use) + if (geo_location && !use_geoclue) { g_signal_handlers_disconnect_by_func (geo_location, update_location_menu_items, 0); g_clear_object (&geo_location); update_location_menu_items (); } - else if (should_use && !using) + else if (use_geoclue && !geo_location) { geo_location = indicator_datetime_location_geoclue_new (); g_signal_connect (geo_location, "notify::timezone", |