From c3a4cf1ca9145df5662d11c06ac728e08ad65792 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Tue, 10 Sep 2013 00:06:00 +0200 Subject: [PATCH 1/7] locator: Add a local priv variable https://bugs.freedesktop.org/show_bug.cgi?id=69105 --- src/gclue-locator.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/gclue-locator.c b/src/gclue-locator.c index ccb30d6..a343260 100644 --- a/src/gclue-locator.c +++ b/src/gclue-locator.c @@ -160,29 +160,30 @@ static void gclue_locator_update_location (GClueLocator *locator, GClueLocationInfo *location) { + GClueLocatorPrivate *priv = locator->priv; gdouble accuracy, new_accuracy, distance; const char *desc, *new_desc; - if (locator->priv->location == NULL) + if (priv->location == NULL) goto update; - accuracy = gclue_location_info_get_accuracy (locator->priv->location); + accuracy = gclue_location_info_get_accuracy (priv->location); new_accuracy = gclue_location_info_get_accuracy (location); - desc = gclue_location_info_get_description (locator->priv->location); + desc = gclue_location_info_get_description (priv->location); new_desc = gclue_location_info_get_description (location); - distance = gclue_location_info_get_distance_from - (locator->priv->location, location); + distance = gclue_location_info_get_distance_from (priv->location, + location); if (accuracy == new_accuracy && g_strcmp0 (desc, new_desc) == 0 && - distance < locator->priv->threshold) { + distance < priv->threshold) { g_debug ("Location remain unchanged"); return; } - g_object_unref (locator->priv->location); + g_object_unref (priv->location); update: g_debug ("Updating location"); - locator->priv->location = g_object_ref (location); + priv->location = g_object_ref (location); g_object_notify (G_OBJECT (locator), "location"); } -- 1.8.3.1