From d54fca81b4943a621ca08e693adc7ba1c96f7a90 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Wed, 9 Apr 2008 11:37:15 +0300 Subject: [PATCH] Use osm_check_location() to check if we need to query a new location or not. --- src/map.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/map.c b/src/map.c index e3626f1..455ca24 100644 --- a/src/map.c +++ b/src/map.c @@ -224,7 +224,7 @@ g_signal_connect(G_OBJECT(map_widget), "button_release_event",G_CALLBACK(map_cb_ g_signal_connect(G_OBJECT(map_widget), "scroll_event", G_CALLBACK(map_cb_scroll_event), NULL); gtk_widget_add_events(map_widget, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK); + | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK); map_poi_init(map_widget); @@ -1327,17 +1327,18 @@ if (_gps->data.fix>1 && !force) else osm_set_way_range(2800); -/* XXX: Don't pulse progress if we don't need to check location ! */ -osm_progress_set_widget(_db, _progress_item); -osm_get_location_data(ilat, ilon, _gps->data.heading, &map_loc); -if (map_loc.valid) - map_set_place_information(map_loc.street, map_loc.primary, map_loc.secondary); -else - map_set_place_information(NULL, NULL, NULL); -osm_progress_set_widget(_db, NULL); - map_update_destination(lat, lon); +if (osm_check_location(&map_loc, ilat, ilon)==FALSE) { + osm_progress_set_widget(_db, _progress_item); + osm_get_location_data(ilat, ilon, _gps->data.heading, &map_loc); + if (map_loc.valid) + map_set_place_information(map_loc.street, map_loc.primary, map_loc.secondary); + else + map_set_place_information(NULL, NULL, NULL); + osm_progress_set_widget(_db, NULL); +} else g_debug("IN PLACE"); + inp=FALSE; } -- 2.39.5