From c213c64cc38fb67dea930f0fd8d8ac241e833d01 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Tue, 10 Sep 2013 00:06:00 +0200 Subject: [PATCH 3/7] locator: Add a local priv variable https://bugs.freedesktop.org/show_bug.cgi?id=69105 --- src/gclue-locator.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/gclue-locator.c b/src/gclue-locator.c index c5e5061..c1ac6ed 100644 --- a/src/gclue-locator.c +++ b/src/gclue-locator.c @@ -160,23 +160,24 @@ static void gclue_locator_update_location (GClueLocator *locator, GClueLocationInfo *location) { + GClueLocatorPrivate *priv = locator->priv; gdouble distance; - if (locator->priv->location == NULL) + if (priv->location == NULL) goto update; - distance = gclue_location_info_get_distance_from - (locator->priv->location, location); - if (gclue_location_info_equal (locator->priv->location, location) && - distance < locator->priv->threshold) { + distance = gclue_location_info_get_distance_from (priv->location, + location); + if (gclue_location_info_equal (priv->location, location) && + distance < priv->threshold) { g_debug ("Location remains 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