Diff of /trunk/src/gpx.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 12 by harbaum, Thu Jun 25 15:24:24 2009 UTC revision 13 by harbaum, Sat Jun 27 11:09:19 2009 UTC
# Line 1069  static gpx_t *gpx_parse_file(gpx_dialog_ Line 1069  static gpx_t *gpx_parse_file(gpx_dialog_
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);
# Line 1356  void gpx_pos_get_distance_str(char *str, Line 1354  void gpx_pos_get_distance_str(char *str,
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;
# Line 1365  void gpx_sort(gpx_t *gpx, int by, pos_t Line 1362  void gpx_sort(gpx_t *gpx, int by, pos_t
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 */

Legend:
Removed from v.12  
changed lines
  Added in v.13