From d19f15e73cc24e71ea4781819442482db86c45d9 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Wed, 13 Feb 2008 14:20:57 +0200 Subject: [PATCH] Add real lat,lon to the store --- src/mapper-types.h | 2 ++ src/route.c | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mapper-types.h b/src/mapper-types.h index 17abe32..9bee657 100644 --- a/src/mapper-types.h +++ b/src/mapper-types.h @@ -49,6 +49,8 @@ typedef enum { ROUTE_LATLON, ROUTE_DISTANCE, ROUTE_WAYPOINT, + ROUTE_LAT, + ROUTE_LON, ROUTE_NUM_COLUMNS } RouteList; diff --git a/src/route.c b/src/route.c index bf3806d..18cb83b 100644 --- a/src/route.c +++ b/src/route.c @@ -759,7 +759,7 @@ if (!wcurr->point) unit2latlon(wcurr->point->unitx, wcurr->point->unity, lat1, lon1); -store = gtk_list_store_new(ROUTE_NUM_COLUMNS,G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); +store = gtk_list_store_new(ROUTE_NUM_COLUMNS,G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_DOUBLE); while (wcurr!=route->wtail) { if (!wcurr) @@ -770,16 +770,18 @@ while (wcurr!=route->wtail) { sum += calculate_distance(lat1, lon1, lat2, lon2); g_snprintf(buffer2, sizeof(buffer2), "%.02f %s", sum * UNITS_CONVERT[_units], UNITS_TEXT[_units]); - lat1=lat2; - lon1=lon2; - gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, ROUTE_LATLON, buffer1, ROUTE_DISTANCE, buffer2, ROUTE_WAYPOINT, wcurr->desc, + ROUTE_LAT, lat2, + ROUTE_LON, lon2, -1); + lat1=lat2; + lon1=lon2; + wcurr++; } -- 2.39.5