]> err.no Git - mapper/commitdiff
Mapper: More integration fixes
authorKaj-Michael Lang <milang@tal.org>
Wed, 23 Jul 2008 09:38:35 +0000 (12:38 +0300)
committerKaj-Michael Lang <milang@tal.org>
Wed, 23 Jul 2008 09:38:35 +0000 (12:38 +0300)
src/cb.c
src/path-mapper.c

index adee9b8fb48e8fc0821e5db18a4b1943839c6710..e3bb934a6d500fb9aae1975e0a3e08946eb77973 100644 (file)
--- a/src/cb.c
+++ b/src/cb.c
@@ -86,7 +86,7 @@ return TRUE;
 gboolean 
 menu_cb_route_download(GtkAction *action)
 {
-route_download(_route, NULL);
+route_download_dialog(_route, NULL);
 route_menu_set_sensitive(path_tree_view_update_store(route_tree_view, _route));
 return TRUE;
 }
@@ -397,7 +397,7 @@ return TRUE;
 gboolean 
 menu_cb_maps_select(GtkAction *action, gpointer new_repo)
 {
-gtk_map_set_repo(_map, new_repo);
+gtk_map_set_tile_repository(_map, new_repo);
 return TRUE;
 }
 
@@ -785,7 +785,7 @@ g_ascii_formatd(strlat, 32, "%.06f", lat);
 g_ascii_formatd(strlon, 32, "%.06f", lon);
 g_snprintf(buffer, sizeof(buffer), "%s, %s", strlat, strlon);
 
-route_download(_route, buffer);
+route_download_dialog(_route, buffer);
 }
 
 void 
@@ -1107,7 +1107,7 @@ gdouble lat, lon;
 gtk_map_get_menu_latlon(_map, &lat, &lon);
 
 if ((way = path_find_nearest_waypoint(_route, lat, lon)))
-       route_show_distance_to(_route, way->point);
+       path_show_distance_to(_route, way->point);
 
 return TRUE;
 }
index d0bf431892ed0cd01527ae2dd8d2b1c91ec867b8..dba603a1cdcc52c9ec0470fe5d1d806b70ed5787 100644 (file)
@@ -104,7 +104,14 @@ if (path && path_has_points(path)) {
 void 
 path_show_distance_from_last(Path *path)
 {
-path_show_distance_from(path, path_find_last_point(path));
+Point *point;
+
+g_return_if_fail(path);
+
+point=path_find_last_point(path);
+g_return_if_fail(point);
+
+path_show_distance_from(path, point);
 }
 
 /**
@@ -114,11 +121,13 @@ path_show_distance_from(path, path_find_last_point(path));
 void 
 path_show_distance_from_first(Path *path)
 {
+g_return_if_fail(path);
+
 path_show_distance_from(path, path->head);
 }
 
 /**
- * route_show_distance_to: 
+ * path_show_distance_to: 
  *
  * Show the distance from the current GPS location to the given point,
  * following the route. If point is NULL, then the distance is shown to the
@@ -168,7 +177,7 @@ path_show_distance_to_last(Path *route)
 g_return_if_fail(route);
 
 if (route->head != route->tail) {
-       route_show_distance_to(route, path_find_last_point(route));
+       path_show_distance_to(route, path_find_last_point(route));
 } else {
        MACRO_BANNER_SHOW_INFO(_window, _("The current route is empty."));
 }
@@ -253,7 +262,7 @@ if (file_open_get_contents(&_route_dir_uri, &buffer, &size)) {
                MACRO_BANNER_SHOW_INFO(_window, _("Route Opened"));
                /* Find the nearest route point, if we're connected. */
                path_find_nearest_point(route, _gps->data.lat, _gps->data.lon);
-               route_set_destination_from_last(route, &_dest);
+               path_set_destination_from_last(route, &_dest);
                return TRUE;
        } else {
                popup_error(_window, _("Error parsing route GPX file."));
@@ -439,7 +448,7 @@ return FALSE;
  * safe to free either string as soon as this function returns.
  */
 gboolean 
-route_download(Path *route, gchar *to)
+route_download_dialog(Path *route, gchar *to)
 {
 GtkWidget *dialog;
 GtkWidget *table;
@@ -621,7 +630,7 @@ while (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
                }
 
                g_free(rdl_data.bytes);
-               route_set_destination_from_last(route, &_dest);
+               path_set_destination_from_last(route, &_dest);
 
                MACRO_BANNER_SHOW_INFO(_window, _("Route Downloaded"));