]> err.no Git - mapper/commitdiff
Path: Don't use gps structs
authorKaj-Michael Lang <milang@tal.org>
Wed, 11 Jun 2008 14:17:38 +0000 (17:17 +0300)
committerKaj-Michael Lang <milang@tal.org>
Wed, 11 Jun 2008 14:17:38 +0000 (17:17 +0300)
src/cb.c
src/path.c
src/path.h
src/ui-common.c

index 204686cff1acb99497087310de8f3ccf8ffe4eeb..e7274b0ebfc5b2d29198548f66b4c6443cc92fae 100644 (file)
--- 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;
 }
index ce9b4a4e9081ce2a67ebce729c509a8ff3819ed2..0af63119bb4dbf7f432457234d4bffb5a95c7a75 100644 (file)
@@ -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
index 7ba8464b6a07b185def0607430a8c8c133de3b37..05462eefa46cfa872626fc12387722c66588025c 100644 (file)
@@ -26,8 +26,6 @@
 #include <gtk/gtk.h>
 #include <libgnomevfs/gnome-vfs.h>
 
-#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);
index a44d641471140b3bd6bf82c6669ff3d5cc617821..14f86559621e12ee3d8aa58f2ba617d9d87ebd31 100644 (file)
@@ -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);