155 |
gtk_window_set_title(GTK_WINDOW(dialog->dialog), _("Loading")); |
gtk_window_set_title(GTK_WINDOW(dialog->dialog), _("Loading")); |
156 |
gtk_window_set_default_size(GTK_WINDOW(dialog->dialog), 300, 10); |
gtk_window_set_default_size(GTK_WINDOW(dialog->dialog), 300, 10); |
157 |
|
|
158 |
gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); |
gtk_window_set_modal(GTK_WINDOW(dialog->dialog), TRUE); |
159 |
gtk_window_set_transient_for(GTK_WINDOW(dialog->dialog), GTK_WINDOW(parent)); |
gtk_window_set_transient_for(GTK_WINDOW(dialog->dialog), GTK_WINDOW(parent)); |
160 |
|
|
161 |
dialog->label = gtk_label_new("---"); |
dialog->label = gtk_label_new("---"); |
463 |
ret = xmlTextReaderRead(reader); |
ret = xmlTextReaderRead(reader); |
464 |
} |
} |
465 |
|
|
466 |
g_assert(0); |
gpx_free_log(log); |
467 |
return log; |
return NULL; |
468 |
} |
} |
469 |
|
|
470 |
static log_t *process_gpx_wpt_gc_logs(xmlTextReaderPtr reader) { |
static log_t *process_gpx_wpt_gc_logs(xmlTextReaderPtr reader) { |
513 |
ret = xmlTextReaderRead(reader); |
ret = xmlTextReaderRead(reader); |
514 |
} |
} |
515 |
|
|
516 |
g_assert(0); |
/* free the entire log chain */ |
517 |
return log_chain; |
while(log_chain) { |
518 |
|
log_t *next = log_chain->next; |
519 |
|
gpx_free_log(log_chain); |
520 |
|
log_chain = next; |
521 |
|
} |
522 |
|
|
523 |
|
return NULL; |
524 |
} |
} |
525 |
|
|
526 |
static tb_t *process_gpx_wpt_gc_tbs_travelbug(xmlTextReaderPtr reader) { |
static tb_t *process_gpx_wpt_gc_tbs_travelbug(xmlTextReaderPtr reader) { |
569 |
ret = xmlTextReaderRead(reader); |
ret = xmlTextReaderRead(reader); |
570 |
} |
} |
571 |
|
|
572 |
g_assert(0); |
gpx_free_tb(tb); |
573 |
return tb; |
return NULL; |
574 |
} |
} |
575 |
|
|
576 |
static tb_t *process_gpx_wpt_gc_tbs(xmlTextReaderPtr reader) { |
static tb_t *process_gpx_wpt_gc_tbs(xmlTextReaderPtr reader) { |
611 |
ret = xmlTextReaderRead(reader); |
ret = xmlTextReaderRead(reader); |
612 |
} |
} |
613 |
|
|
614 |
g_assert(0); |
while(tb) { |
615 |
return tb; |
tb_t *next = tb; |
616 |
|
gpx_free_tb(tb); |
617 |
|
tb = next; |
618 |
|
} |
619 |
|
|
620 |
|
return NULL; |
621 |
} |
} |
622 |
|
|
623 |
static void process_gpx_wpt_gc(xmlTextReaderPtr reader, cache_t *cache) { |
static void process_gpx_wpt_gc(xmlTextReaderPtr reader, cache_t *cache) { |
775 |
/* neither geocaching.com GC* nor opencaching.com OC* nor */ |
/* neither geocaching.com GC* nor opencaching.com OC* nor */ |
776 |
/* geocaching australia GA* waypoint */ |
/* geocaching australia GA* waypoint */ |
777 |
if(cache->id && |
if(cache->id && |
778 |
|
(strncasecmp(cache->id, "__", 2) != 0) && |
779 |
(strncasecmp(cache->id, "GC", 2) != 0) && |
(strncasecmp(cache->id, "GC", 2) != 0) && |
780 |
(strncasecmp(cache->id, "OC", 2) != 0) && |
(strncasecmp(cache->id, "OC", 2) != 0) && |
781 |
(strncasecmp(cache->id, "GA", 2) != 0)) { |
(strncasecmp(cache->id, "GA", 2) != 0)) { |
842 |
ret = xmlTextReaderRead(reader); |
ret = xmlTextReaderRead(reader); |
843 |
} |
} |
844 |
|
|
845 |
g_assert(0); |
gpx_free_cache(cache); |
846 |
return cache; |
return NULL; |
847 |
} |
} |
848 |
|
|
849 |
static void process_gpx(xmlTextReaderPtr reader, gpx_dialog_t *dialog, |
static gboolean process_gpx(xmlTextReaderPtr reader, gpx_dialog_t *dialog, |
850 |
gpx_t *gpx) { |
gpx_t *gpx) { |
851 |
|
|
852 |
/* no attributes of interest */ |
/* no attributes of interest */ |
853 |
|
|
858 |
while(*cache) cache = &(*cache)->next; |
while(*cache) cache = &(*cache)->next; |
859 |
|
|
860 |
const xmlChar *name = xmlTextReaderConstName(reader); |
const xmlChar *name = xmlTextReaderConstName(reader); |
861 |
g_assert(name); |
if(!name) return FALSE; |
862 |
|
|
863 |
/* read next node */ |
/* read next node */ |
864 |
int ret = xmlTextReaderRead(reader); |
int ret = xmlTextReaderRead(reader); |
888 |
case XML_READER_TYPE_END_ELEMENT: |
case XML_READER_TYPE_END_ELEMENT: |
889 |
/* end element must be for the current element */ |
/* end element must be for the current element */ |
890 |
g_assert(xmlTextReaderDepth(reader) == 0); |
g_assert(xmlTextReaderDepth(reader) == 0); |
891 |
return; |
return TRUE; |
892 |
break; |
break; |
893 |
|
|
894 |
default: |
default: |
897 |
ret = xmlTextReaderRead(reader); |
ret = xmlTextReaderRead(reader); |
898 |
} |
} |
899 |
|
|
900 |
g_assert(0); |
return FALSE; |
901 |
} |
} |
902 |
|
|
903 |
/* parse loc waypoint entry */ |
/* parse loc waypoint entry */ |
1357 |
|
|
1358 |
void gpx_pos_get_distance_str(char *str, int len, |
void gpx_pos_get_distance_str(char *str, int len, |
1359 |
pos_t p1, pos_t p2, int mil) { |
pos_t p1, pos_t p2, int mil) { |
1360 |
if(!p1.lat && !p1.lon) { |
if(isnan(p1.lat) || isnan(p1.lon)) { |
1361 |
snprintf(str, len, "---"); |
snprintf(str, len, "---"); |
1362 |
return; |
return; |
1363 |
} |
} |