]> err.no Git - mapper/commitdiff
Use osm_check_location() to check if we need to query a new location or not.
authorKaj-Michael Lang <milang@tal.org>
Wed, 9 Apr 2008 08:37:15 +0000 (11:37 +0300)
committerKaj-Michael Lang <milang@tal.org>
Wed, 9 Apr 2008 08:37:15 +0000 (11:37 +0300)
src/map.c

index e3626f115d3b5ae15a10657b0809a9eef4e3ee23..455ca249252b89ac3129fa154590015b089eb064 100644 (file)
--- 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;
 }