1069 |
*dot = 0; |
*dot = 0; |
1070 |
snprintf(wpts_name, sizeof(wpts_name), "%s-wpts.gpx", filename); |
snprintf(wpts_name, sizeof(wpts_name), "%s-wpts.gpx", filename); |
1071 |
*dot = '.'; |
*dot = '.'; |
|
|
|
1072 |
if(g_file_test(wpts_name, G_FILE_TEST_EXISTS)) { |
if(g_file_test(wpts_name, G_FILE_TEST_EXISTS)) { |
|
|
|
1073 |
xmlTextReaderPtr reader = xmlReaderForFile(wpts_name, NULL, 0); |
xmlTextReaderPtr reader = xmlReaderForFile(wpts_name, NULL, 0); |
1074 |
if (reader != NULL) { |
if (reader != NULL) { |
1075 |
gpx = process_root(reader, dialog, wpts_name, gpx); |
gpx = process_root(reader, dialog, wpts_name, gpx); |
1354 |
distance_str(str, len, dist, mil); |
distance_str(str, len, dist, mil); |
1355 |
} |
} |
1356 |
|
|
|
/* http://library.gnome.org/devel/gtk/unstable/GtkRadioButton.html */ |
|
1357 |
void gpx_sort(gpx_t *gpx, int by, pos_t *refpos) { |
void gpx_sort(gpx_t *gpx, int by, pos_t *refpos) { |
1358 |
cache_t **new; |
cache_t **new; |
1359 |
cache_t *cur = gpx->cache; |
cache_t *cur = gpx->cache; |
1362 |
|
|
1363 |
gpx->cache = NULL; /* detach old chain */ |
gpx->cache = NULL; /* detach old chain */ |
1364 |
while(cur) { |
while(cur) { |
1365 |
float cur_dist = gpx_pos_get_distance(*refpos, gpx_cache_pos(cur), 0); |
float cur_dist = -1; |
1366 |
int cur_cnt = 0; |
int cur_cnt = 0; |
1367 |
|
|
1368 |
|
if(!isnan(cur->pos.lat) && !isnan(cur->pos.lon)) |
1369 |
|
cur_dist = gpx_pos_get_distance(*refpos, gpx_cache_pos(cur), 0); |
1370 |
|
|
1371 |
new = &(gpx->cache); |
new = &(gpx->cache); |
1372 |
|
|
1373 |
/* search for currect insertion point */ |
/* search for currect insertion point */ |