From 6a180adb2e9a0e58ded90e6d4e9226051254be23 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Wed, 11 Jun 2008 17:17:38 +0300 Subject: [PATCH] Path: Don't use gps structs --- src/cb.c | 3 +-- src/path.c | 25 ------------------------- src/path.h | 3 --- src/ui-common.c | 2 +- 4 files changed, 2 insertions(+), 31 deletions(-) diff --git a/src/cb.c b/src/cb.c index 204686c..e7274b0 100644 --- a/src/cb.c +++ b/src/cb.c @@ -1027,8 +1027,7 @@ gboolean cmenu_cb_loc_set_gps(GtkAction *action) { gtk_map_get_menu_latlon(_map, &_gps->data.lat, &_gps->data.lon); -_gps->data.time=time(NULL); -path_add_point(_track, &_gps->data); +path_add_latlon(_track, _gps->data.lat, _gps->data.lon, time(NULL), 0, NAN); return TRUE; } diff --git a/src/path.c b/src/path.c index ce9b4a4..0af6311 100644 --- a/src/path.c +++ b/src/path.c @@ -28,7 +28,6 @@ #include "path.h" #include "position.h" #include "utils.h" -#include "gps.h" #include "settings.h" #include "latlon.h" @@ -280,30 +279,6 @@ g_signal_emit(G_OBJECT(path), signals[NEW_WAYPOINT], 0, NULL); return TRUE; } -/** - * path_add_point: - * @path - * @gps - * - * Append a point using given gps data. Adds a path break if gps is not valid. - * - * Returns: TRUE if the new point was added. FALSE is returned if new point distance was under sensitivity setting. - */ -gboolean -path_add_point(Path *path, GpsData *gps) -{ -guint unitx, unity; - -g_return_val_if_fail(path, FALSE); - -if (!gps) { - path_add_break(path); - return FALSE; -} - -return path_add_latlon(path, gps->lat, gps->lon, gps->time, gps->speed, gps->altitude); -} - /** * path_add_latlon: * @path diff --git a/src/path.h b/src/path.h index 7ba8464..05462ee 100644 --- a/src/path.h +++ b/src/path.h @@ -26,8 +26,6 @@ #include #include -#include "gpsdata.h" - G_BEGIN_DECLS #define PATH_TYPE (path_get_type ()) @@ -187,7 +185,6 @@ void path_find_nearest_point(Path *path); gboolean path_update_nears(Path *route, Point *point, gboolean quick); gboolean path_add_latlon(Path *path, gdouble lat, gdouble lon, time_t ptime, gfloat speed, gfloat altitude); -gboolean path_add_point(Path *path, GpsData *gps); gboolean path_has_points(Path *path); gboolean path_has_waypoints(Path *path); diff --git a/src/ui-common.c b/src/ui-common.c index a44d641..14f8655 100644 --- a/src/ui-common.c +++ b/src/ui-common.c @@ -830,7 +830,7 @@ gps_location_update(Gps *gps) { g_assert(gps); if (filter_check(&filter, &gps->data, &map_loc)==TRUE) { - if (path_add_point(_track, &_gps->data)) { + if (path_add_latlon(_track, _gps->data.lat, _gps->data.lon, _gps->data.time, _gps->data.speed, _gps->data.altitude)) { path_check_waypoint_announce(_route, &_gps->data); #if 0 route_autoroute_check(_route); -- 2.39.5