1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

Data/map loading code cleanup

This commit is contained in:
Martin Tůma 2017-07-27 19:47:46 +02:00
parent fad3f116f5
commit 81e1664a9b
25 changed files with 820 additions and 742 deletions

View File

@ -25,6 +25,54 @@
<translation>Maximum</translation>
</message>
</context>
<context>
<name>Data</name>
<message>
<location filename="../src/data.cpp" line="93"/>
<source>Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</source>
<translation>Podporované soubory (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="94"/>
<source>CSV files (*.csv)</source>
<translation>Soubory CSV (*.csv)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="94"/>
<source>FIT files (*.fit)</source>
<translation>Soubory FIT (*.fit)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="95"/>
<source>GPX files (*.gpx)</source>
<translation>Soubory GPX (*.gpx)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="95"/>
<source>IGC files (*.igc)</source>
<translation>Soubory IGC (*.igc)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="96"/>
<source>KML files (*.kml)</source>
<translation>Soubory KML (*.kml)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="96"/>
<source>NMEA files (*.nmea)</source>
<translation>Soubory NMEA (*.nmea)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="97"/>
<source>TCX files (*.tcx)</source>
<translation>Soubory TCX (*.tcx)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="97"/>
<source>All files (*)</source>
<translation>Všechny soubory (*)</translation>
</message>
</context>
<context>
<name>ElevationGraph</name>
<message>
@ -190,366 +238,321 @@
<context>
<name>GUI</name>
<message>
<location filename="../src/gui.cpp" line="655"/>
<location filename="../src/gui.cpp" line="645"/>
<source>GPXSee is distributed under the terms of the GNU General Public License version 3. For more info about GPXSee visit the project homepage at </source>
<translation>Program GPXSee je distribuován pod podmínkami licence GNU General Public License verze 3. Pro více informací navštivte stránky programu na adrese </translation>
</message>
<message>
<location filename="../src/gui.cpp" line="733"/>
<location filename="../src/gui.cpp" line="724"/>
<source>Open file</source>
<translation>Otevřít soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="823"/>
<location filename="../src/gui.cpp" line="814"/>
<source>Open POI file</source>
<translation>Otevřít POI soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="296"/>
<location filename="../src/gui.cpp" line="282"/>
<source>Quit</source>
<translation>Ukončit</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="304"/>
<location filename="../src/gui.cpp" line="671"/>
<location filename="../src/gui.cpp" line="672"/>
<location filename="../src/gui.cpp" line="291"/>
<location filename="../src/gui.cpp" line="662"/>
<location filename="../src/gui.cpp" line="663"/>
<source>Keyboard controls</source>
<translation>Ovládací klávesy</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="328"/>
<location filename="../src/gui.cpp" line="316"/>
<source>Close</source>
<translation>Zavřít</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="334"/>
<location filename="../src/gui.cpp" line="322"/>
<source>Reload</source>
<translation>Znovu načíst</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="585"/>
<location filename="../src/gui.cpp" line="574"/>
<source>Show</source>
<translation>Zobrazit</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="502"/>
<location filename="../src/gui.cpp" line="579"/>
<location filename="../src/gui.cpp" line="491"/>
<location filename="../src/gui.cpp" line="568"/>
<source>File</source>
<translation>Soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="108"/>
<source>FIT files (*.fit)</source>
<translation>Soubory FIT (*.fit)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="109"/>
<source>IGC files (*.igc)</source>
<translation>Soubory IGC (*.igc)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="110"/>
<source>NMEA files (*.nmea)</source>
<translation>Soubory NMEA (*.nmea)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="302"/>
<location filename="../src/gui.cpp" line="700"/>
<location filename="../src/gui.cpp" line="701"/>
<location filename="../src/gui.cpp" line="289"/>
<location filename="../src/gui.cpp" line="691"/>
<location filename="../src/gui.cpp" line="692"/>
<source>Data sources</source>
<translation>Zdroje dat</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="345"/>
<location filename="../src/gui.cpp" line="333"/>
<source>Close POI files</source>
<translation>Zavřit POI soubory</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="347"/>
<location filename="../src/gui.cpp" line="335"/>
<source>Overlap POIs</source>
<translation>Překrývat POI</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="351"/>
<location filename="../src/gui.cpp" line="339"/>
<source>Show POI labels</source>
<translation>Zobrazit názvy POI</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="356"/>
<location filename="../src/gui.cpp" line="344"/>
<source>Show POIs</source>
<translation>Zobrazit POI</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="365"/>
<location filename="../src/gui.cpp" line="353"/>
<source>Show map</source>
<translation>Zobrazit mapu</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="375"/>
<location filename="../src/gui.cpp" line="363"/>
<source>Clear tile cache</source>
<translation>Vymazat mezipaměť dlaždic</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="312"/>
<location filename="../src/gui.cpp" line="300"/>
<source>Open...</source>
<translation>Otevřít...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="342"/>
<location filename="../src/gui.cpp" line="330"/>
<source>Load POI file...</source>
<translation>Nahrát POI soubor...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="373"/>
<location filename="../src/gui.cpp" line="361"/>
<source>Load map...</source>
<translation>Nahrát mapu...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="379"/>
<location filename="../src/gui.cpp" line="383"/>
<location filename="../src/gui.cpp" line="683"/>
<location filename="../src/gui.cpp" line="367"/>
<location filename="../src/gui.cpp" line="371"/>
<location filename="../src/gui.cpp" line="674"/>
<source>Next map</source>
<translation>Následující mapa</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="393"/>
<location filename="../src/gui.cpp" line="381"/>
<source>Show tracks</source>
<translation>Zobrazit cesty</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="397"/>
<location filename="../src/gui.cpp" line="385"/>
<source>Show routes</source>
<translation>Zobrazit trasy</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="401"/>
<location filename="../src/gui.cpp" line="389"/>
<source>Show waypoints</source>
<translation>Zobrazit navigační body</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="405"/>
<location filename="../src/gui.cpp" line="393"/>
<source>Waypoint labels</source>
<translation>Názvy navigačních bodů</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="416"/>
<location filename="../src/gui.cpp" line="404"/>
<source>Show graphs</source>
<translation>Zobrazit grafy</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="438"/>
<location filename="../src/gui.cpp" line="426"/>
<source>Show grid</source>
<translation>Zobrazit mřížku</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="444"/>
<location filename="../src/gui.cpp" line="432"/>
<source>Show toolbars</source>
<translation>Zobrazovat nástrojové lišty</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="450"/>
<location filename="../src/gui.cpp" line="438"/>
<source>Total time</source>
<translation>Celkový čas</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="455"/>
<location filename="../src/gui.cpp" line="1015"/>
<location filename="../src/gui.cpp" line="443"/>
<location filename="../src/gui.cpp" line="1006"/>
<source>Moving time</source>
<translation>Čistý čas</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="462"/>
<location filename="../src/gui.cpp" line="450"/>
<source>Metric</source>
<translation>Metrické</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="467"/>
<location filename="../src/gui.cpp" line="455"/>
<source>Imperial</source>
<translation>Imperiální</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="473"/>
<location filename="../src/gui.cpp" line="461"/>
<source>Fullscreen mode</source>
<translation>Celoobrazovkový režim</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="479"/>
<location filename="../src/gui.cpp" line="467"/>
<source>Options...</source>
<translation>Nastavení...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="484"/>
<location filename="../src/gui.cpp" line="473"/>
<source>Next</source>
<translation>Následující</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="487"/>
<location filename="../src/gui.cpp" line="476"/>
<source>Previous</source>
<translation>Předchozí</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="491"/>
<location filename="../src/gui.cpp" line="480"/>
<source>Last</source>
<translation>Poslední</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="494"/>
<location filename="../src/gui.cpp" line="483"/>
<source>First</source>
<translation>První</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="516"/>
<location filename="../src/gui.cpp" line="505"/>
<source>Map</source>
<translation>Mapa</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="524"/>
<location filename="../src/gui.cpp" line="513"/>
<source>Graph</source>
<translation>Graf</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="532"/>
<location filename="../src/gui.cpp" line="521"/>
<source>POI</source>
<translation>POI</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="533"/>
<location filename="../src/gui.cpp" line="522"/>
<source>POI files</source>
<translation>POI soubory</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="544"/>
<location filename="../src/gui.cpp" line="533"/>
<source>Data</source>
<translation>Data</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="545"/>
<location filename="../src/gui.cpp" line="534"/>
<source>Display</source>
<translation>Zobrazit</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="553"/>
<location filename="../src/gui.cpp" line="542"/>
<source>Settings</source>
<translation>Nastavení</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="557"/>
<location filename="../src/gui.cpp" line="546"/>
<source>Units</source>
<translation>Jednotky</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="566"/>
<location filename="../src/gui.cpp" line="555"/>
<source>Help</source>
<translation>Nápověda</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="681"/>
<location filename="../src/gui.cpp" line="672"/>
<source>Append file</source>
<translation>Přidat soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="682"/>
<location filename="../src/gui.cpp" line="673"/>
<source>Next/Previous</source>
<translation>Následující/Předchozí</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="685"/>
<location filename="../src/gui.cpp" line="676"/>
<source>Previous map</source>
<translation>Předchozí mapa</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="686"/>
<location filename="../src/gui.cpp" line="677"/>
<source>Zoom in</source>
<translation>Přiblížit</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="688"/>
<location filename="../src/gui.cpp" line="679"/>
<source>Zoom out</source>
<translation>Oddálit</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="690"/>
<location filename="../src/gui.cpp" line="681"/>
<source>Digital zoom</source>
<translation>Digitální zoom</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="691"/>
<location filename="../src/gui.cpp" line="682"/>
<source>Zoom</source>
<translation>Zoom</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="703"/>
<location filename="../src/gui.cpp" line="694"/>
<source>Online maps</source>
<translation>Online mapy</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="704"/>
<location filename="../src/gui.cpp" line="695"/>
<source>Online map URLs are read on program startup from the following file:</source>
<translation>URL online map jsou načteny při startu programu z následujícího souboru:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="715"/>
<location filename="../src/gui.cpp" line="706"/>
<source>Offline maps are loaded on program startup from the following directory:</source>
<translation>Offline mapy jsou načítány při startu aplikace z následujícího adresáře:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="1206"/>
<location filename="../src/gui.cpp" line="1197"/>
<source>Open map file</source>
<translation>Otevřít mapový soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="1239"/>
<location filename="../src/gui.cpp" line="1233"/>
<source>No files loaded</source>
<translation>Nejsou načteny žádné soubory</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="109"/>
<source>GPX files (*.gpx)</source>
<translation>Soubory GPX (*.gpx)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="111"/>
<source>TCX files (*.tcx)</source>
<translation>Soubory TCX (*.tcx)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="110"/>
<source>KML files (*.kml)</source>
<translation>Soubory KML (*.kml)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="108"/>
<source>CSV files (*.csv)</source>
<translation>Soubory CSV (*.csv)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="111"/>
<source>All files (*)</source>
<translation>Všechny soubory (*)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="1001"/>
<location filename="../src/gui.cpp" line="1004"/>
<location filename="../src/gui.cpp" line="992"/>
<location filename="../src/gui.cpp" line="995"/>
<source>Date</source>
<translation>Datum</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="993"/>
<location filename="../src/gui.cpp" line="984"/>
<source>Routes</source>
<translation>Trasy</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="1207"/>
<source>Map files (*.map *.tba *.tar)</source>
<translation>Mapové soubory (*.map *.tba *.tar)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="1224"/>
<location filename="../src/gui.cpp" line="1218"/>
<source>Error loading map:</source>
<translation>Mapu nelze načíst:</translation>
</message>
<message numerus="yes">
<location filename="../src/gui.cpp" line="1243"/>
<location filename="../src/gui.cpp" line="1237"/>
<source>%n files</source>
<translation>
<numerusform>%n soubor</numerusform>
@ -558,127 +561,122 @@
</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="675"/>
<location filename="../src/gui.cpp" line="666"/>
<source>Next file</source>
<translation>Následující soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="652"/>
<location filename="../src/gui.cpp" line="642"/>
<source>Version </source>
<translation>Verze </translation>
</message>
<message>
<location filename="../src/gui.cpp" line="317"/>
<location filename="../src/gui.cpp" line="305"/>
<source>Print...</source>
<translation>Tisknout...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="322"/>
<location filename="../src/gui.cpp" line="310"/>
<source>Export to PDF...</source>
<translation>Exportovat do PDF...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="995"/>
<location filename="../src/gui.cpp" line="986"/>
<source>Waypoints</source>
<translation>Navigační body</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="676"/>
<location filename="../src/gui.cpp" line="667"/>
<source>Previous file</source>
<translation>Předchozí soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="107"/>
<source>Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</source>
<translation>Podporované soubory (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="409"/>
<location filename="../src/gui.cpp" line="397"/>
<source>Route waypoints</source>
<translation>Body tras</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="678"/>
<location filename="../src/gui.cpp" line="669"/>
<source>First file</source>
<translation>První soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="680"/>
<location filename="../src/gui.cpp" line="671"/>
<source>Last file</source>
<translation>Poslední soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="707"/>
<location filename="../src/gui.cpp" line="698"/>
<source>The file format is one map entry per line, consisting of the map name and tiles URL delimited by a TAB character. The tile X and Y coordinates are replaced with $x and $y in the URL and the zoom level is replaced with $z. An example map file could look like:</source>
<translation>Formát souboru je jeden mapový záznam na řádku, kde mapový záznam sestává ze jména mapy a URL dlaždic navzájem oddělených tabulátorem. Souřadnice dlaždice jsou v URL nahrazeny řetězci $x a $y, úroven přiblížení (zoom) pak řetězcem $z. Příklad:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="714"/>
<location filename="../src/gui.cpp" line="705"/>
<source>Offline maps</source>
<translation>Offline mapy</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="718"/>
<location filename="../src/gui.cpp" line="709"/>
<source>The expected structure is one map/atlas in a separate subdirectory. Supported map formats are OziExplorer maps and TrekBuddy maps/atlases (tared and non-tared).</source>
<translation>Očekávaná struktura je jedna mapa/atlas v samostatném podadresáři. Podporované mapové formáty jsou OziExplorer mapy a TrekBuddy mapy/atlasy (včetně tar varianty).</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="723"/>
<location filename="../src/gui.cpp" line="714"/>
<source>To make GPXSee load a POI file automatically on startup, add the file to the following directory:</source>
<translation>POI soubory, které se mají automaticky nahrát při startu programu jsou načítány z následujícího adresáře:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="812"/>
<location filename="../src/gui.cpp" line="803"/>
<source>Error loading data file:</source>
<translation>Datový soubor nelze načíst:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="815"/>
<location filename="../src/gui.cpp" line="840"/>
<location filename="../src/gui.cpp" line="806"/>
<location filename="../src/gui.cpp" line="831"/>
<source>Line: %1</source>
<translation>Řádka: %1</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="837"/>
<location filename="../src/gui.cpp" line="828"/>
<source>Error loading POI file:</source>
<translation>Soubor POI nelze načíst:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="987"/>
<location filename="../src/gui.cpp" line="978"/>
<source>Name</source>
<translation>Název</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="991"/>
<location filename="../src/gui.cpp" line="982"/>
<source>Tracks</source>
<translation>Cesty</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="307"/>
<location filename="../src/gui.cpp" line="651"/>
<location filename="../src/gui.cpp" line="294"/>
<location filename="../src/gui.cpp" line="641"/>
<source>About GPXSee</source>
<translation>O aplikaci GPXSee</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="590"/>
<location filename="../src/gui.cpp" line="579"/>
<source>Navigation</source>
<translation>Navigace</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="722"/>
<location filename="../src/gui.cpp" line="713"/>
<source>POIs</source>
<translation>POI body</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="424"/>
<location filename="../src/gui.cpp" line="1011"/>
<location filename="../src/gui.cpp" line="412"/>
<location filename="../src/gui.cpp" line="1002"/>
<source>Distance</source>
<translation>Vzdálenost</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="431"/>
<location filename="../src/gui.cpp" line="554"/>
<location filename="../src/gui.cpp" line="1013"/>
<location filename="../src/gui.cpp" line="419"/>
<location filename="../src/gui.cpp" line="543"/>
<location filename="../src/gui.cpp" line="1004"/>
<source>Time</source>
<translation>Čas</translation>
</message>
@ -756,6 +754,19 @@
<translation>Maximum</translation>
</message>
</context>
<context>
<name>MapList</name>
<message>
<location filename="../src/maplist.cpp" line="127"/>
<source>Map files (*.map *.tba *.tar)</source>
<translation>Mapové soubory (*.map *.tba *.tar)</translation>
</message>
<message>
<location filename="../src/maplist.cpp" line="128"/>
<source>URL list files (*.txt)</source>
<translation>Seznamy URL (*.txt)</translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>

View File

@ -25,6 +25,54 @@
<translation>Maximum</translation>
</message>
</context>
<context>
<name>Data</name>
<message>
<location filename="../src/data.cpp" line="93"/>
<source>Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</source>
<translation>Unterstütze Dateien (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="94"/>
<source>CSV files (*.csv)</source>
<translation>CSV-Dateien (*.csv)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="94"/>
<source>FIT files (*.fit)</source>
<translation>FIT-Dateien (*.fit)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="95"/>
<source>GPX files (*.gpx)</source>
<translation>GPX-Dateien (*.gpx)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="95"/>
<source>IGC files (*.igc)</source>
<translation>IGC-Dateien (*.igc)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="96"/>
<source>KML files (*.kml)</source>
<translation>KML-Dateien (*.kml)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="96"/>
<source>NMEA files (*.nmea)</source>
<translation>NMEA-Dateien (*.nmea)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="97"/>
<source>TCX files (*.tcx)</source>
<translation>TCX-Dateien (*.tcx)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="97"/>
<source>All files (*)</source>
<translation>Alle Dateien (*)</translation>
</message>
</context>
<context>
<name>ElevationGraph</name>
<message>
@ -190,335 +238,315 @@
<context>
<name>GUI</name>
<message>
<location filename="../src/gui.cpp" line="655"/>
<location filename="../src/gui.cpp" line="645"/>
<source>GPXSee is distributed under the terms of the GNU General Public License version 3. For more info about GPXSee visit the project homepage at </source>
<translation>GPXSee wird unter der GNU General Public License version 3 vertrieben. Mehr Informationen zu GPXSee auf der Homepage </translation>
</message>
<message>
<location filename="../src/gui.cpp" line="733"/>
<location filename="../src/gui.cpp" line="724"/>
<source>Open file</source>
<translation>Datei öffnen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="823"/>
<location filename="../src/gui.cpp" line="814"/>
<source>Open POI file</source>
<translation>POI Datei öffnen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="296"/>
<location filename="../src/gui.cpp" line="282"/>
<source>Quit</source>
<translation>Beenden</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="304"/>
<location filename="../src/gui.cpp" line="671"/>
<location filename="../src/gui.cpp" line="672"/>
<location filename="../src/gui.cpp" line="291"/>
<location filename="../src/gui.cpp" line="662"/>
<location filename="../src/gui.cpp" line="663"/>
<source>Keyboard controls</source>
<translation>Tastaturkürzel</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="328"/>
<location filename="../src/gui.cpp" line="316"/>
<source>Close</source>
<translation>Schließen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="334"/>
<location filename="../src/gui.cpp" line="322"/>
<source>Reload</source>
<translation>Neu Laden</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="585"/>
<location filename="../src/gui.cpp" line="574"/>
<source>Show</source>
<translation>Ansicht</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="502"/>
<location filename="../src/gui.cpp" line="579"/>
<location filename="../src/gui.cpp" line="491"/>
<location filename="../src/gui.cpp" line="568"/>
<source>File</source>
<translation>Datei</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="108"/>
<source>FIT files (*.fit)</source>
<translation>FIT-Dateien (*.fit)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="109"/>
<source>IGC files (*.igc)</source>
<translation>IGC-Dateien (*.igc)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="110"/>
<source>NMEA files (*.nmea)</source>
<translation>NMEA-Dateien (*.nmea)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="302"/>
<location filename="../src/gui.cpp" line="700"/>
<location filename="../src/gui.cpp" line="701"/>
<location filename="../src/gui.cpp" line="289"/>
<location filename="../src/gui.cpp" line="691"/>
<location filename="../src/gui.cpp" line="692"/>
<source>Data sources</source>
<translation>Datenquellen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="345"/>
<location filename="../src/gui.cpp" line="333"/>
<source>Close POI files</source>
<translation>POI-Datei schließen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="347"/>
<location filename="../src/gui.cpp" line="335"/>
<source>Overlap POIs</source>
<translation>POI überlappen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="351"/>
<location filename="../src/gui.cpp" line="339"/>
<source>Show POI labels</source>
<translation>POI-Labels anzeigen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="356"/>
<location filename="../src/gui.cpp" line="344"/>
<source>Show POIs</source>
<translation>POIs anzeigen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="365"/>
<location filename="../src/gui.cpp" line="353"/>
<source>Show map</source>
<translation>Karte anzeigen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="375"/>
<location filename="../src/gui.cpp" line="363"/>
<source>Clear tile cache</source>
<translation>Tile-Cache bereinigen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="312"/>
<location filename="../src/gui.cpp" line="300"/>
<source>Open...</source>
<translation>Öffnen...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="342"/>
<location filename="../src/gui.cpp" line="330"/>
<source>Load POI file...</source>
<translation>POI-Datei laden...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="373"/>
<location filename="../src/gui.cpp" line="361"/>
<source>Load map...</source>
<translation>Karte laden...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="379"/>
<location filename="../src/gui.cpp" line="383"/>
<location filename="../src/gui.cpp" line="683"/>
<location filename="../src/gui.cpp" line="367"/>
<location filename="../src/gui.cpp" line="371"/>
<location filename="../src/gui.cpp" line="674"/>
<source>Next map</source>
<translation>Nächste Karte</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="393"/>
<location filename="../src/gui.cpp" line="381"/>
<source>Show tracks</source>
<translation>Strecken anzeigen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="397"/>
<location filename="../src/gui.cpp" line="385"/>
<source>Show routes</source>
<translation>Routen anzeigen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="401"/>
<location filename="../src/gui.cpp" line="389"/>
<source>Show waypoints</source>
<translation>Wegpunkte anzeigen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="405"/>
<location filename="../src/gui.cpp" line="393"/>
<source>Waypoint labels</source>
<translation>Wegpunkt Labels</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="416"/>
<location filename="../src/gui.cpp" line="404"/>
<source>Show graphs</source>
<translation>Graphen anzeigen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="438"/>
<location filename="../src/gui.cpp" line="426"/>
<source>Show grid</source>
<translation>Gitter anzeigen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="444"/>
<location filename="../src/gui.cpp" line="432"/>
<source>Show toolbars</source>
<translation>Toolbars anzeigen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="450"/>
<location filename="../src/gui.cpp" line="438"/>
<source>Total time</source>
<translation>Gesamtzeit</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="455"/>
<location filename="../src/gui.cpp" line="1015"/>
<location filename="../src/gui.cpp" line="443"/>
<location filename="../src/gui.cpp" line="1006"/>
<source>Moving time</source>
<translation>Bewegungszeit</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="462"/>
<location filename="../src/gui.cpp" line="450"/>
<source>Metric</source>
<translation>Metrisch</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="467"/>
<location filename="../src/gui.cpp" line="455"/>
<source>Imperial</source>
<translation>Imperial</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="473"/>
<location filename="../src/gui.cpp" line="461"/>
<source>Fullscreen mode</source>
<translation>Vollbildmodus</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="479"/>
<location filename="../src/gui.cpp" line="467"/>
<source>Options...</source>
<translation>Einstellungen...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="484"/>
<location filename="../src/gui.cpp" line="473"/>
<source>Next</source>
<translation>Nächste</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="487"/>
<location filename="../src/gui.cpp" line="476"/>
<source>Previous</source>
<translation>Vorherige</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="491"/>
<location filename="../src/gui.cpp" line="480"/>
<source>Last</source>
<translation>Letzte</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="494"/>
<location filename="../src/gui.cpp" line="483"/>
<source>First</source>
<translation>Erste</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="516"/>
<location filename="../src/gui.cpp" line="505"/>
<source>Map</source>
<translation>Karte</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="524"/>
<location filename="../src/gui.cpp" line="513"/>
<source>Graph</source>
<translation>Graph</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="532"/>
<location filename="../src/gui.cpp" line="521"/>
<source>POI</source>
<translation>POI</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="533"/>
<location filename="../src/gui.cpp" line="522"/>
<source>POI files</source>
<translation>POI-Dateien</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="544"/>
<location filename="../src/gui.cpp" line="533"/>
<source>Data</source>
<translation>Daten</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="545"/>
<location filename="../src/gui.cpp" line="534"/>
<source>Display</source>
<translation>Anzeige</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="553"/>
<location filename="../src/gui.cpp" line="542"/>
<source>Settings</source>
<translation>Einstellungen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="557"/>
<location filename="../src/gui.cpp" line="546"/>
<source>Units</source>
<translation>Einheiten</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="566"/>
<location filename="../src/gui.cpp" line="555"/>
<source>Help</source>
<translation>Hilfe</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="681"/>
<location filename="../src/gui.cpp" line="672"/>
<source>Append file</source>
<translation>An Datei anhängen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="682"/>
<location filename="../src/gui.cpp" line="673"/>
<source>Next/Previous</source>
<translation>Nächste/Vorherige</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="685"/>
<location filename="../src/gui.cpp" line="676"/>
<source>Previous map</source>
<translation>Vorherige Karte</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="686"/>
<location filename="../src/gui.cpp" line="677"/>
<source>Zoom in</source>
<translation>Hineinzoomen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="688"/>
<location filename="../src/gui.cpp" line="679"/>
<source>Zoom out</source>
<translation>Herauszoomen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="690"/>
<location filename="../src/gui.cpp" line="681"/>
<source>Digital zoom</source>
<translation>Digitaler Zoom</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="691"/>
<location filename="../src/gui.cpp" line="682"/>
<source>Zoom</source>
<translation>Zoom</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="703"/>
<location filename="../src/gui.cpp" line="694"/>
<source>Online maps</source>
<translation>Onlinekarten</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="704"/>
<location filename="../src/gui.cpp" line="695"/>
<source>Online map URLs are read on program startup from the following file:</source>
<translation>Onlinekarten URLs werden zu Programmstart aus der folgenden Datei gelesen:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="714"/>
<location filename="../src/gui.cpp" line="705"/>
<source>Offline maps</source>
<translation>Offlinekarten</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="715"/>
<location filename="../src/gui.cpp" line="706"/>
<source>Offline maps are loaded on program startup from the following directory:</source>
<translation>Offlinekarten werden zu Programmstart aus dem folgenden Verzeichnis geladen:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="1206"/>
<location filename="../src/gui.cpp" line="1197"/>
<source>Open map file</source>
<translation>Karte Datei öffnen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="1207"/>
<source>Map files (*.map *.tba *.tar)</source>
<translation>Karten-Dateien (*.map *.tba *.tar)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="1224"/>
<location filename="../src/gui.cpp" line="1218"/>
<source>Error loading map:</source>
<translation>Fehler beim Laden der Karte-Datei:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="1239"/>
<location filename="../src/gui.cpp" line="1233"/>
<source>No files loaded</source>
<translation>Keine Dateien geladen</translation>
</message>
<message numerus="yes">
<location filename="../src/gui.cpp" line="1243"/>
<location filename="../src/gui.cpp" line="1237"/>
<source>%n files</source>
<translation>
<numerusform>%n Datei</numerusform>
@ -526,158 +554,128 @@
</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="109"/>
<source>GPX files (*.gpx)</source>
<translation>GPX-Dateien (*.gpx)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="111"/>
<source>TCX files (*.tcx)</source>
<translation>TCX-Dateien (*.tcx)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="110"/>
<source>KML files (*.kml)</source>
<translation>KML-Dateien (*.kml)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="108"/>
<source>CSV files (*.csv)</source>
<translation>CSV-Dateien (*.csv)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="111"/>
<source>All files (*)</source>
<translation>Alle Dateien (*)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="1001"/>
<location filename="../src/gui.cpp" line="1004"/>
<location filename="../src/gui.cpp" line="992"/>
<location filename="../src/gui.cpp" line="995"/>
<source>Date</source>
<translation>Datum</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="993"/>
<location filename="../src/gui.cpp" line="984"/>
<source>Routes</source>
<translation>Routen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="675"/>
<location filename="../src/gui.cpp" line="666"/>
<source>Next file</source>
<translation>Nächste Datei</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="652"/>
<location filename="../src/gui.cpp" line="642"/>
<source>Version </source>
<translation>Version </translation>
</message>
<message>
<location filename="../src/gui.cpp" line="317"/>
<location filename="../src/gui.cpp" line="305"/>
<source>Print...</source>
<translation>Drucken...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="322"/>
<location filename="../src/gui.cpp" line="310"/>
<source>Export to PDF...</source>
<translation>Als PDF exportieren...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="995"/>
<location filename="../src/gui.cpp" line="986"/>
<source>Waypoints</source>
<translation>Wegpunkte</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="676"/>
<location filename="../src/gui.cpp" line="667"/>
<source>Previous file</source>
<translation>Vorherige Datei</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="107"/>
<source>Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</source>
<translation>Unterstütze Dateien (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="409"/>
<location filename="../src/gui.cpp" line="397"/>
<source>Route waypoints</source>
<translation>Routen Wegpunkte</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="678"/>
<location filename="../src/gui.cpp" line="669"/>
<source>First file</source>
<translation>Erste Datei</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="680"/>
<location filename="../src/gui.cpp" line="671"/>
<source>Last file</source>
<translation>Letzte Datei</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="707"/>
<location filename="../src/gui.cpp" line="698"/>
<source>The file format is one map entry per line, consisting of the map name and tiles URL delimited by a TAB character. The tile X and Y coordinates are replaced with $x and $y in the URL and the zoom level is replaced with $z. An example map file could look like:</source>
<translation>Das Dateiformat ist eine Karte pro Linie. Jede Linie besteht aus dem Kartenname und die durch ein TAB Zeichen getrennte Tiles URL. X und Y Koordinate einer Tile werden in der URL durch $x und $y ersetzt und das Zoomlevel durch $z. Ein Beispiel einer Kartendatei könnte so aussehen:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="718"/>
<location filename="../src/gui.cpp" line="709"/>
<source>The expected structure is one map/atlas in a separate subdirectory. Supported map formats are OziExplorer maps and TrekBuddy maps/atlases (tared and non-tared).</source>
<translation>Die erwartete Struktur ist eine Karte/ein Atlas pro Unterverzeichnis. Unterstützte Kartenformate sind OziExplorer Karten und TrekBuddy Karten/Atlanten (mit oder ohne tar Kompression).</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="723"/>
<location filename="../src/gui.cpp" line="714"/>
<source>To make GPXSee load a POI file automatically on startup, add the file to the following directory:</source>
<translation>Damit GPXSee zu Programmstart automatisch eine POI-Datei lädt, fügen Sie diese zu folgendem Verzeichnis hinzu:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="812"/>
<location filename="../src/gui.cpp" line="803"/>
<source>Error loading data file:</source>
<translation>Fehler beim Laden der Datei:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="815"/>
<location filename="../src/gui.cpp" line="840"/>
<location filename="../src/gui.cpp" line="806"/>
<location filename="../src/gui.cpp" line="831"/>
<source>Line: %1</source>
<translation>Linie: %1</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="837"/>
<location filename="../src/gui.cpp" line="828"/>
<source>Error loading POI file:</source>
<translation>Fehler beim Laden der POI-Datei:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="987"/>
<location filename="../src/gui.cpp" line="978"/>
<source>Name</source>
<translation>Name</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="991"/>
<location filename="../src/gui.cpp" line="982"/>
<source>Tracks</source>
<translation>Strecken</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="307"/>
<location filename="../src/gui.cpp" line="651"/>
<location filename="../src/gui.cpp" line="294"/>
<location filename="../src/gui.cpp" line="641"/>
<source>About GPXSee</source>
<translation>Über GPXSee</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="590"/>
<location filename="../src/gui.cpp" line="579"/>
<source>Navigation</source>
<translation>Navigation</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="722"/>
<location filename="../src/gui.cpp" line="713"/>
<source>POIs</source>
<translation>POIs</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="424"/>
<location filename="../src/gui.cpp" line="1011"/>
<location filename="../src/gui.cpp" line="412"/>
<location filename="../src/gui.cpp" line="1002"/>
<source>Distance</source>
<translation>Distanz</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="431"/>
<location filename="../src/gui.cpp" line="554"/>
<location filename="../src/gui.cpp" line="1013"/>
<location filename="../src/gui.cpp" line="419"/>
<location filename="../src/gui.cpp" line="543"/>
<location filename="../src/gui.cpp" line="1004"/>
<source>Time</source>
<translation>Zeit</translation>
</message>
@ -755,6 +753,19 @@
<translation>Maximum</translation>
</message>
</context>
<context>
<name>MapList</name>
<message>
<location filename="../src/maplist.cpp" line="127"/>
<source>Map files (*.map *.tba *.tar)</source>
<translation>Karten-Dateien (*.map *.tba *.tar)</translation>
</message>
<message>
<location filename="../src/maplist.cpp" line="128"/>
<source>URL list files (*.txt)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="sv">
<TS version="2.1" language="sv">
<context>
<name>CadenceGraph</name>
<message>
@ -25,6 +25,54 @@
<translation>Maximal</translation>
</message>
</context>
<context>
<name>Data</name>
<message>
<location filename="../src/data.cpp" line="93"/>
<source>Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</source>
<translation>Filer som stöds (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="94"/>
<source>CSV files (*.csv)</source>
<translation>CSV-filer (*.csv)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="94"/>
<source>FIT files (*.fit)</source>
<translation>FIT-filer (*.fit)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="95"/>
<source>GPX files (*.gpx)</source>
<translation>GPX-filer (*.gpx)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="95"/>
<source>IGC files (*.igc)</source>
<translation>IGC-filer (*.igc)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="96"/>
<source>KML files (*.kml)</source>
<translation>KML-filer (*.kml)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="96"/>
<source>NMEA files (*.nmea)</source>
<translation>NMEA-filer (*.nmea)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="97"/>
<source>TCX files (*.tcx)</source>
<translation>TCX-filer (*.tcx)</translation>
</message>
<message>
<location filename="../src/data.cpp" line="97"/>
<source>All files (*)</source>
<translation>Alla filer (*)</translation>
</message>
</context>
<context>
<name>ElevationGraph</name>
<message>
@ -190,335 +238,315 @@
<context>
<name>GUI</name>
<message>
<location filename="../src/gui.cpp" line="655"/>
<location filename="../src/gui.cpp" line="645"/>
<source>GPXSee is distributed under the terms of the GNU General Public License version 3. For more info about GPXSee visit the project homepage at </source>
<translation>GPXSee distribueras under vilkoren för GNU General Public License version 3. För mer info om GPXSee, besök hemsidan </translation>
</message>
<message>
<location filename="../src/gui.cpp" line="733"/>
<location filename="../src/gui.cpp" line="724"/>
<source>Open file</source>
<translation>Öppna fil</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="823"/>
<location filename="../src/gui.cpp" line="814"/>
<source>Open POI file</source>
<translation>Öppna POI-fil</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="296"/>
<location filename="../src/gui.cpp" line="282"/>
<source>Quit</source>
<translation>Avsluta</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="304"/>
<location filename="../src/gui.cpp" line="671"/>
<location filename="../src/gui.cpp" line="672"/>
<location filename="../src/gui.cpp" line="291"/>
<location filename="../src/gui.cpp" line="662"/>
<location filename="../src/gui.cpp" line="663"/>
<source>Keyboard controls</source>
<translation>Snabbtangenter</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="328"/>
<location filename="../src/gui.cpp" line="316"/>
<source>Close</source>
<translation>Stäng</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="334"/>
<location filename="../src/gui.cpp" line="322"/>
<source>Reload</source>
<translation>Uppdatera</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="585"/>
<location filename="../src/gui.cpp" line="574"/>
<source>Show</source>
<translation>Visa</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="502"/>
<location filename="../src/gui.cpp" line="579"/>
<location filename="../src/gui.cpp" line="491"/>
<location filename="../src/gui.cpp" line="568"/>
<source>File</source>
<translation>Arkiv</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="108"/>
<source>FIT files (*.fit)</source>
<translation>FIT-filer (*.fit)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="109"/>
<source>IGC files (*.igc)</source>
<translation>IGC-filer (*.igc)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="110"/>
<source>NMEA files (*.nmea)</source>
<translation>NMEA-filer (*.nmea)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="302"/>
<location filename="../src/gui.cpp" line="700"/>
<location filename="../src/gui.cpp" line="701"/>
<location filename="../src/gui.cpp" line="289"/>
<location filename="../src/gui.cpp" line="691"/>
<location filename="../src/gui.cpp" line="692"/>
<source>Data sources</source>
<translation>Datakällor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="345"/>
<location filename="../src/gui.cpp" line="333"/>
<source>Close POI files</source>
<translation>Stäng POI-filer</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="347"/>
<location filename="../src/gui.cpp" line="335"/>
<source>Overlap POIs</source>
<translation>Överlappa POI:er</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="351"/>
<location filename="../src/gui.cpp" line="339"/>
<source>Show POI labels</source>
<translation>Visa POI-namn</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="356"/>
<location filename="../src/gui.cpp" line="344"/>
<source>Show POIs</source>
<translation>Visa POI:er</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="365"/>
<location filename="../src/gui.cpp" line="353"/>
<source>Show map</source>
<translation>Visa karta</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="375"/>
<location filename="../src/gui.cpp" line="363"/>
<source>Clear tile cache</source>
<translation>Rensa kart-cache</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="312"/>
<location filename="../src/gui.cpp" line="300"/>
<source>Open...</source>
<translation>Öppna...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="342"/>
<location filename="../src/gui.cpp" line="330"/>
<source>Load POI file...</source>
<translation>Läs in POI-fil...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="373"/>
<location filename="../src/gui.cpp" line="361"/>
<source>Load map...</source>
<translation>Läs in karta...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="379"/>
<location filename="../src/gui.cpp" line="383"/>
<location filename="../src/gui.cpp" line="683"/>
<location filename="../src/gui.cpp" line="367"/>
<location filename="../src/gui.cpp" line="371"/>
<location filename="../src/gui.cpp" line="674"/>
<source>Next map</source>
<translation>Nästa karta</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="393"/>
<location filename="../src/gui.cpp" line="381"/>
<source>Show tracks</source>
<translation>Visa spår</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="397"/>
<location filename="../src/gui.cpp" line="385"/>
<source>Show routes</source>
<translation>Visa rutter</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="401"/>
<location filename="../src/gui.cpp" line="389"/>
<source>Show waypoints</source>
<translation>Visa vägpunkter</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="405"/>
<location filename="../src/gui.cpp" line="393"/>
<source>Waypoint labels</source>
<translation>Vägpunktsnamn</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="416"/>
<location filename="../src/gui.cpp" line="404"/>
<source>Show graphs</source>
<translation>Visa diagram</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="438"/>
<location filename="../src/gui.cpp" line="426"/>
<source>Show grid</source>
<translation>Visa stödlinjer</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="444"/>
<location filename="../src/gui.cpp" line="432"/>
<source>Show toolbars</source>
<translation>Visa verktygsfält</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="450"/>
<location filename="../src/gui.cpp" line="438"/>
<source>Total time</source>
<translation>Total tid</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="455"/>
<location filename="../src/gui.cpp" line="1015"/>
<location filename="../src/gui.cpp" line="443"/>
<location filename="../src/gui.cpp" line="1006"/>
<source>Moving time</source>
<translation>Förflyttningstid</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="462"/>
<location filename="../src/gui.cpp" line="450"/>
<source>Metric</source>
<translation>Meter</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="467"/>
<location filename="../src/gui.cpp" line="455"/>
<source>Imperial</source>
<translation>Imperial</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="473"/>
<location filename="../src/gui.cpp" line="461"/>
<source>Fullscreen mode</source>
<translation>Helskärmsläge</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="479"/>
<location filename="../src/gui.cpp" line="467"/>
<source>Options...</source>
<translation>Alternativ...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="484"/>
<location filename="../src/gui.cpp" line="473"/>
<source>Next</source>
<translation>Nästa</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="487"/>
<location filename="../src/gui.cpp" line="476"/>
<source>Previous</source>
<translation>Föregående</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="491"/>
<location filename="../src/gui.cpp" line="480"/>
<source>Last</source>
<translation>Sista</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="494"/>
<location filename="../src/gui.cpp" line="483"/>
<source>First</source>
<translation>Första</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="516"/>
<location filename="../src/gui.cpp" line="505"/>
<source>Map</source>
<translation>Karta</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="524"/>
<location filename="../src/gui.cpp" line="513"/>
<source>Graph</source>
<translation>Diagram</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="532"/>
<location filename="../src/gui.cpp" line="521"/>
<source>POI</source>
<translation>POI</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="533"/>
<location filename="../src/gui.cpp" line="522"/>
<source>POI files</source>
<translation>POI-filer</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="544"/>
<location filename="../src/gui.cpp" line="533"/>
<source>Data</source>
<translation>Data</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="545"/>
<location filename="../src/gui.cpp" line="534"/>
<source>Display</source>
<translation>Visa</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="553"/>
<location filename="../src/gui.cpp" line="542"/>
<source>Settings</source>
<translation>Inställningar</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="557"/>
<location filename="../src/gui.cpp" line="546"/>
<source>Units</source>
<translation>Enhet</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="566"/>
<location filename="../src/gui.cpp" line="555"/>
<source>Help</source>
<translation>Hjälp</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="681"/>
<location filename="../src/gui.cpp" line="672"/>
<source>Append file</source>
<translation>Lägg till fil</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="682"/>
<location filename="../src/gui.cpp" line="673"/>
<source>Next/Previous</source>
<translation>Nästa/Föregående</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="685"/>
<location filename="../src/gui.cpp" line="676"/>
<source>Previous map</source>
<translation>Föregående karta</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="686"/>
<location filename="../src/gui.cpp" line="677"/>
<source>Zoom in</source>
<translation>Zooma in</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="688"/>
<location filename="../src/gui.cpp" line="679"/>
<source>Zoom out</source>
<translation>Zooma ut</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="690"/>
<location filename="../src/gui.cpp" line="681"/>
<source>Digital zoom</source>
<translation>Digital zoom</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="691"/>
<location filename="../src/gui.cpp" line="682"/>
<source>Zoom</source>
<translation>Zoom</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="703"/>
<location filename="../src/gui.cpp" line="694"/>
<source>Online maps</source>
<translation>Online-kartor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="704"/>
<location filename="../src/gui.cpp" line="695"/>
<source>Online map URLs are read on program startup from the following file:</source>
<translation>Online-kartors URL:er, läses från följande fil vid programstart:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="714"/>
<location filename="../src/gui.cpp" line="705"/>
<source>Offline maps</source>
<translation>Offline-kartor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="715"/>
<location filename="../src/gui.cpp" line="706"/>
<source>Offline maps are loaded on program startup from the following directory:</source>
<translation>Offline-kartor läses in från följande mapp vid programstart:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="1206"/>
<location filename="../src/gui.cpp" line="1197"/>
<source>Open map file</source>
<translation>Öppna kartfil</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="1207"/>
<source>Map files (*.map *.tba *.tar)</source>
<translation>Kartfiler (*.map *.tba *.tar)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="1224"/>
<location filename="../src/gui.cpp" line="1218"/>
<source>Error loading map:</source>
<translation>Fel vid inläsning av karta:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="1239"/>
<location filename="../src/gui.cpp" line="1233"/>
<source>No files loaded</source>
<translation>Inga filer inlästa</translation>
</message>
<message numerus="yes">
<location filename="../src/gui.cpp" line="1243"/>
<location filename="../src/gui.cpp" line="1237"/>
<source>%n files</source>
<translation>
<numerusform>%n filer</numerusform>
@ -526,158 +554,128 @@
</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="109"/>
<source>GPX files (*.gpx)</source>
<translation>GPX-filer (*.gpx)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="111"/>
<source>TCX files (*.tcx)</source>
<translation>TCX-filer (*.tcx)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="110"/>
<source>KML files (*.kml)</source>
<translation>KML-filer (*.kml)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="108"/>
<source>CSV files (*.csv)</source>
<translation>CSV-filer (*.csv)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="111"/>
<source>All files (*)</source>
<translation>Alla filer (*)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="1001"/>
<location filename="../src/gui.cpp" line="1004"/>
<location filename="../src/gui.cpp" line="992"/>
<location filename="../src/gui.cpp" line="995"/>
<source>Date</source>
<translation>Datum</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="993"/>
<location filename="../src/gui.cpp" line="984"/>
<source>Routes</source>
<translation>Rutter</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="675"/>
<location filename="../src/gui.cpp" line="666"/>
<source>Next file</source>
<translation>Nästa fil</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="652"/>
<location filename="../src/gui.cpp" line="642"/>
<source>Version </source>
<translation>Version </translation>
</message>
<message>
<location filename="../src/gui.cpp" line="317"/>
<location filename="../src/gui.cpp" line="305"/>
<source>Print...</source>
<translation>Skriv ut...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="322"/>
<location filename="../src/gui.cpp" line="310"/>
<source>Export to PDF...</source>
<translation>Exportera till PDF...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="995"/>
<location filename="../src/gui.cpp" line="986"/>
<source>Waypoints</source>
<translation>Vägpunkter</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="676"/>
<location filename="../src/gui.cpp" line="667"/>
<source>Previous file</source>
<translation>Föregående fil</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="107"/>
<source>Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</source>
<translation>Filer som stöds (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="409"/>
<location filename="../src/gui.cpp" line="397"/>
<source>Route waypoints</source>
<translation>Ruttvägpunkter</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="678"/>
<location filename="../src/gui.cpp" line="669"/>
<source>First file</source>
<translation>Första filen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="680"/>
<location filename="../src/gui.cpp" line="671"/>
<source>Last file</source>
<translation>Sista filen</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="707"/>
<location filename="../src/gui.cpp" line="698"/>
<source>The file format is one map entry per line, consisting of the map name and tiles URL delimited by a TAB character. The tile X and Y coordinates are replaced with $x and $y in the URL and the zoom level is replaced with $z. An example map file could look like:</source>
<translation>Filformatet är en kartpost per rad, bestående av kartnamn och kartrutans URL, avgränsade med ett TAB-tecken. Kartrutans X- och Y-koordinater ersätts med $x och $y i URL:en och zoomnivån ersätts med $z. Exempel en kartfil kan se ut här:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="718"/>
<location filename="../src/gui.cpp" line="709"/>
<source>The expected structure is one map/atlas in a separate subdirectory. Supported map formats are OziExplorer maps and TrekBuddy maps/atlases (tared and non-tared).</source>
<translation>Den förväntade strukturen är en karta/atlas i en separat undermapp. Kartformat som stöds är OziExplorer kartor och TrekBuddy-kartor/-kartsamlingar (tarerade och icke tarerade).</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="723"/>
<location filename="../src/gui.cpp" line="714"/>
<source>To make GPXSee load a POI file automatically on startup, add the file to the following directory:</source>
<translation>För att GPXSee skall läsa in en POI-fil automatiskt vid programstart, läggs filen i följande mapp:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="812"/>
<location filename="../src/gui.cpp" line="803"/>
<source>Error loading data file:</source>
<translation>Fel vid inläsning av datafil:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="815"/>
<location filename="../src/gui.cpp" line="840"/>
<location filename="../src/gui.cpp" line="806"/>
<location filename="../src/gui.cpp" line="831"/>
<source>Line: %1</source>
<translation>Rad: %1</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="837"/>
<location filename="../src/gui.cpp" line="828"/>
<source>Error loading POI file:</source>
<translation>Fel vid inläsning av POI-fil:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="987"/>
<location filename="../src/gui.cpp" line="978"/>
<source>Name</source>
<translation>Namn</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="991"/>
<location filename="../src/gui.cpp" line="982"/>
<source>Tracks</source>
<translation>Spår</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="307"/>
<location filename="../src/gui.cpp" line="651"/>
<location filename="../src/gui.cpp" line="294"/>
<location filename="../src/gui.cpp" line="641"/>
<source>About GPXSee</source>
<translation>Om GPXSee</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="590"/>
<location filename="../src/gui.cpp" line="579"/>
<source>Navigation</source>
<translation>Navigation</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="722"/>
<location filename="../src/gui.cpp" line="713"/>
<source>POIs</source>
<translation>POI:er</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="424"/>
<location filename="../src/gui.cpp" line="1011"/>
<location filename="../src/gui.cpp" line="412"/>
<location filename="../src/gui.cpp" line="1002"/>
<source>Distance</source>
<translation>Avstånd</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="431"/>
<location filename="../src/gui.cpp" line="554"/>
<location filename="../src/gui.cpp" line="1013"/>
<location filename="../src/gui.cpp" line="419"/>
<location filename="../src/gui.cpp" line="543"/>
<location filename="../src/gui.cpp" line="1004"/>
<source>Time</source>
<translation>Tid</translation>
</message>
@ -755,6 +753,19 @@
<translation>Max</translation>
</message>
</context>
<context>
<name>MapList</name>
<message>
<location filename="../src/maplist.cpp" line="127"/>
<source>Map files (*.map *.tba *.tar)</source>
<translation>Kartfiler (*.map *.tba *.tar)</translation>
</message>
<message>
<location filename="../src/maplist.cpp" line="128"/>
<source>URL list files (*.txt)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>

View File

@ -1,7 +1,10 @@
#include "csvparser.h"
bool CSVParser::loadFile(QFile *file)
bool CSVParser::parse(QFile *file, QList<TrackData> &track,
QList<RouteData> &routes, QList<Waypoint> &waypoints)
{
Q_UNUSED(track);
Q_UNUSED(routes);
bool res;
_errorLine = 1;
@ -36,7 +39,7 @@ bool CSVParser::loadFile(QFile *file)
wp.setDescription(QString::fromUtf8(ba.data(), ba.size()));
}
_waypoints.append(wp);
waypoints.append(wp);
_errorLine++;
}

View File

@ -6,12 +6,11 @@
class CSVParser : public Parser
{
public:
CSVParser(QList<TrackData> &tracks, QList<RouteData> &routes,
QList<Waypoint> &waypoints) : Parser(tracks, routes, waypoints)
{_errorLine = 0;}
CSVParser() : _errorLine(0) {}
~CSVParser() {}
bool loadFile(QFile *file);
bool parse(QFile *file, QList<TrackData> &track, QList<RouteData> &routes,
QList<Waypoint> &waypoints);
QString errorString() const {return _errorString;}
int errorLine() const {return _errorLine;}

View File

@ -11,38 +11,32 @@
#include "data.h"
Data::Data() : _errorLine(0)
static QHash<QString, Parser*> parsers()
{
_parsers.insert("gpx", new GPXParser(_trackData, _routeData,
_waypointData));
_parsers.insert("tcx", new TCXParser(_trackData, _routeData,
_waypointData));
_parsers.insert("kml", new KMLParser(_trackData, _routeData,
_waypointData));
_parsers.insert("fit", new FITParser(_trackData, _routeData,
_waypointData));
_parsers.insert("csv", new CSVParser(_trackData, _routeData,
_waypointData));
_parsers.insert("igc", new IGCParser(_trackData, _routeData,
_waypointData));
_parsers.insert("nmea", new NMEAParser(_trackData, _routeData,
_waypointData));
QHash<QString, Parser*> hash;
hash.insert("gpx", new GPXParser());
hash.insert("tcx", new TCXParser());
hash.insert("kml", new KMLParser());
hash.insert("fit", new FITParser());
hash.insert("csv", new CSVParser());
hash.insert("igc", new IGCParser());
hash.insert("nmea", new NMEAParser());
return hash;
}
QHash<QString, Parser*> Data::_parsers = parsers();
Data::~Data()
{
QHash<QString, Parser*>::iterator it;
for (it = _parsers.begin(); it != _parsers.end(); it++)
delete it.value();
for (int i = 0; i < _tracks.count(); i++)
delete _tracks.at(i);
for (int i = 0; i < _routes.count(); i++)
delete _routes.at(i);
}
void Data::createData()
void Data::processData()
{
for (int i = 0; i < _trackData.count(); i++)
_tracks.append(new Track(_trackData.at(i)));
@ -66,8 +60,8 @@ bool Data::loadFile(const QString &fileName)
QHash<QString, Parser*>::iterator it;
if ((it = _parsers.find(fi.suffix().toLower())) != _parsers.end()) {
if (it.value()->loadFile(&file)) {
createData();
if (it.value()->parse(&file, _trackData, _routeData, _waypoints)) {
processData();
return true;
}
@ -75,8 +69,8 @@ bool Data::loadFile(const QString &fileName)
_errorString = it.value()->errorString();
} else {
for (it = _parsers.begin(); it != _parsers.end(); it++) {
if (it.value()->loadFile(&file)) {
createData();
if (it.value()->parse(&file, _trackData, _routeData, _waypoints)) {
processData();
return true;
}
file.reset();
@ -93,3 +87,23 @@ bool Data::loadFile(const QString &fileName)
return false;
}
QString Data::formats()
{
return tr("Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)")
+ ";;" + tr("CSV files (*.csv)") + ";;" + tr("FIT files (*.fit)") + ";;"
+ tr("GPX files (*.gpx)") + ";;" + tr("IGC files (*.igc)") + ";;"
+ tr("KML files (*.kml)") + ";;" + tr("NMEA files (*.nmea)") + ";;"
+ tr("TCX files (*.tcx)") + ";;" + tr("All files (*)");
}
QStringList Data::filter()
{
QStringList filter;
QHash<QString, Parser*>::iterator it;
for (it = _parsers.begin(); it != _parsers.end(); it++)
filter << QString("*.%1").arg(it.key());
return filter;
}

View File

@ -6,16 +6,19 @@
#include <QHash>
#include <QPointF>
#include <QString>
#include <QStringList>
#include "waypoint.h"
#include "track.h"
#include "route.h"
#include "parser.h"
class Data
class Data : public QObject
{
Q_OBJECT
public:
Data();
Data(QObject *parent = 0) : QObject(parent), _errorLine(0) {}
~Data();
bool loadFile(const QString &fileName);
@ -24,21 +27,25 @@ public:
const QList<Track*> &tracks() const {return _tracks;}
const QList<Route*> &routes() const {return _routes;}
const QList<Waypoint> &waypoints() const {return _waypointData;}
const QList<Waypoint> &waypoints() const {return _waypoints;}
static QString formats();
static QStringList filter();
private:
void createData();
void processData();
QString _errorString;
int _errorLine;
QHash<QString, Parser*> _parsers;
QList<Track*> _tracks;
QList<Route*> _routes;
QList<Waypoint> _waypoints;
QList<TrackData> _trackData;
QList<RouteData> _routeData;
QList<Waypoint> _waypointData;
static QHash<QString, Parser*> _parsers;
};
#endif // DATA_H

View File

@ -10,8 +10,7 @@ const quint32 FIT_MAGIC = 0x5449462E; // .FIT
#define TIMESTAMP_FIELD 253
FITParser::FITParser(QList<TrackData> &tracks, QList<RouteData> &routes,
QList<Waypoint> &waypoints) : Parser(tracks, routes, waypoints)
FITParser::FITParser()
{
memset(_defs, 0, sizeof(_defs));
@ -191,7 +190,8 @@ bool FITParser::readField(Field *f, quint32 &val)
return ret;
}
bool FITParser::parseData(MessageDefinition *def, quint8 offset)
bool FITParser::parseData(TrackData &track, MessageDefinition *def,
quint8 offset)
{
Field *field;
quint32 timestamp = _timestamp + offset;
@ -268,7 +268,7 @@ bool FITParser::parseData(MessageDefinition *def, quint8 offset)
if (trackpoint.coordinates().isValid()) {
trackpoint.setTimestamp(QDateTime::fromTime_t(timestamp
+ 631065600));
_tracks.last().append(trackpoint);
track.append(trackpoint);
} else {
if (trackpoint.coordinates().isNull())
warning("Missing coordinates");
@ -282,21 +282,21 @@ bool FITParser::parseData(MessageDefinition *def, quint8 offset)
return true;
}
bool FITParser::parseDataMessage(quint8 header)
bool FITParser::parseDataMessage(TrackData &track, quint8 header)
{
int local_id = header & 0xf;
MessageDefinition* def = &_defs[local_id];
return parseData(def, 0);
return parseData(track, def, 0);
}
bool FITParser::parseCompressedMessage(quint8 header)
bool FITParser::parseCompressedMessage(TrackData &track, quint8 header)
{
int local_id = (header >> 5) & 3;
MessageDefinition* def = &_defs[local_id];
return parseData(def, header & 0x1f);
return parseData(track, def, header & 0x1f);
}
bool FITParser::parseRecord()
bool FITParser::parseRecord(TrackData &track)
{
quint8 header;
@ -304,11 +304,11 @@ bool FITParser::parseRecord()
return false;
if (header & 0x80)
return parseCompressedMessage(header);
return parseCompressedMessage(track, header);
else if (header & 0x40)
return parseDefinitionMessage(header);
else
return parseDataMessage(header);
return parseDataMessage(track, header);
}
bool FITParser::parseHeader()
@ -337,8 +337,11 @@ bool FITParser::parseHeader()
return true;
}
bool FITParser::loadFile(QFile *file)
bool FITParser::parse(QFile *file, QList<TrackData> &tracks,
QList<RouteData> &routes, QList<Waypoint> &waypoints)
{
Q_UNUSED(routes);
Q_UNUSED(waypoints);
bool ret = true;
_device = file;
@ -348,10 +351,11 @@ bool FITParser::loadFile(QFile *file)
if (!parseHeader())
return false;
_tracks.append(TrackData());
tracks.append(TrackData());
TrackData &track = tracks.last();
while (_len)
if ((ret = parseRecord()) == false)
if ((ret = parseRecord(track)) == false)
break;
clearDefinitions();

View File

@ -6,11 +6,11 @@
class FITParser : public Parser
{
public:
FITParser(QList<TrackData> &tracks, QList<RouteData> &routes,
QList<Waypoint> &waypoints);
FITParser();
~FITParser() {}
bool loadFile(QFile *file);
bool parse(QFile *file, QList<TrackData> &tracks, QList<RouteData> &routes,
QList<Waypoint> &waypoints);
QString errorString() const {return _errorString;}
int errorLine() const {return 0;}
@ -47,11 +47,11 @@ private:
bool skipValue(size_t size);
bool parseHeader();
bool parseRecord();
bool parseRecord(TrackData &track);
bool parseDefinitionMessage(quint8 header);
bool parseCompressedMessage(quint8 header);
bool parseDataMessage(quint8 header);
bool parseData(MessageDefinition *def, quint8 offset);
bool parseCompressedMessage(TrackData &track, quint8 header);
bool parseDataMessage(TrackData &track, quint8 header);
bool parseData(TrackData &track, MessageDefinition *def, quint8 offset);
bool readField(Field *f, quint32 &val);
QIODevice *_device;

View File

@ -167,39 +167,36 @@ void GPXParser::track(TrackData &track)
}
}
void GPXParser::gpx()
void GPXParser::gpx(QList<TrackData> &tracks, QList<RouteData> &routes,
QList<Waypoint> &waypoints)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "trk") {
_tracks.append(TrackData());
track(_tracks.back());
tracks.append(TrackData());
track(tracks.back());
} else if (_reader.name() == "rte") {
_routes.append(RouteData());
routepoints(_routes.back());
routes.append(RouteData());
routepoints(routes.back());
} else if (_reader.name() == "wpt") {
_waypoints.append(Waypoint(coordinates()));
waypointData(_waypoints.last());
waypoints.append(Waypoint(coordinates()));
waypointData(waypoints.last());
} else
_reader.skipCurrentElement();
}
}
bool GPXParser::parse()
bool GPXParser::parse(QFile *file, QList<TrackData> &tracks,
QList<RouteData> &routes, QList<Waypoint> &waypoints)
{
_reader.clear();
_reader.setDevice(file);
if (_reader.readNextStartElement()) {
if (_reader.name() == "gpx")
gpx();
gpx(tracks, routes, waypoints);
else
_reader.raiseError("Not a GPX file");
}
return !_reader.error();
}
bool GPXParser::loadFile(QFile *file)
{
_reader.clear();
_reader.setDevice(file);
return parse();
}

View File

@ -8,17 +8,16 @@
class GPXParser : public Parser
{
public:
GPXParser(QList<TrackData> &tracks, QList<RouteData> &routes,
QList<Waypoint> &waypoints) : Parser(tracks, routes, waypoints) {}
~GPXParser() {}
bool loadFile(QFile *file);
bool parse(QFile *file, QList<TrackData> &tracks,
QList<RouteData> &routes, QList<Waypoint> &waypoints);
QString errorString() const {return _reader.errorString();}
int errorLine() const {return _reader.lineNumber();}
private:
bool parse();
void gpx();
void gpx(QList<TrackData> &tracks, QList<RouteData> &routes,
QList<Waypoint> &waypoints);
void track(TrackData &track);
void trackpoints(TrackData &track);
void routepoints(RouteData &route);

View File

@ -102,24 +102,6 @@ GUI::~GUI()
}
}
const QString GUI::fileFormats() const
{
return tr("Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)")
+ ";;" + tr("CSV files (*.csv)") + ";;" + tr("FIT files (*.fit)") + ";;"
+ tr("GPX files (*.gpx)") + ";;" + tr("IGC files (*.igc)") + ";;"
+ tr("KML files (*.kml)") + ";;" + tr("NMEA files (*.nmea)") + ";;"
+ tr("TCX files (*.tcx)") + ";;" + tr("All files (*)");
}
void GUI::createBrowser()
{
QStringList filter;
filter << "*.gpx" << "*.tcx" << "*.kml" << "*.fit" << "*.csv" << "*.igc"
<< "*.nmea";
_browser = new FileBrowser(this);
_browser->setFilter(filter);
}
void GUI::loadDatums()
{
QString ef, df;
@ -175,7 +157,7 @@ void GUI::loadMaps()
else if (QFile::exists(GLOBAL_MAP_FILE))
online = GLOBAL_MAP_FILE;
if (!online.isNull() && !_ml->loadList(online))
if (!online.isNull() && !_ml->loadFile(online))
qWarning("%s: %s", qPrintable(online), qPrintable(_ml->errorString()));
@ -187,12 +169,10 @@ void GUI::loadMaps()
if (!offline.isNull()) {
QDir md(offline);
QFileInfoList ml = md.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
QStringList filters;
filters << "*.map" << "*.tba" << "*.tar";
for (int i = 0; i < ml.size(); i++) {
QDir dir(ml.at(i).absoluteFilePath());
QFileInfoList fl = dir.entryInfoList(filters, QDir::Files);
QFileInfoList fl = dir.entryInfoList(MapList::filter(), QDir::Files);
if (fl.isEmpty())
qWarning("%s: no map/atlas file found",
@ -201,7 +181,7 @@ void GUI::loadMaps()
qWarning("%s: ambiguous directory content",
qPrintable(ml.at(i).absoluteFilePath()));
else
if (!_ml->loadMap(fl.first().absoluteFilePath()))
if (!_ml->loadFile(fl.first().absoluteFilePath()))
qWarning("%s: %s", qPrintable(fl.first().absoluteFilePath()),
qPrintable(_ml->errorString()));
}
@ -234,6 +214,12 @@ void GUI::loadPOIs()
}
}
void GUI::createBrowser()
{
_browser = new FileBrowser(this);
_browser->setFilter(Data::filter());
}
void GUI::createMapActions()
{
_mapsSignalMapper = new QSignalMapper(this);
@ -736,7 +722,7 @@ void GUI::dataSources()
void GUI::openFile()
{
QStringList files = QFileDialog::getOpenFileNames(this, tr("Open file"),
QString(), fileFormats());
QString(), Data::formats());
QStringList list = files;
for (QStringList::Iterator it = list.begin(); it != list.end(); it++)
@ -826,7 +812,7 @@ bool GUI::loadFile(const QString &fileName)
void GUI::openPOIFile()
{
QStringList files = QFileDialog::getOpenFileNames(this, tr("Open POI file"),
QString(), fileFormats());
QString(), Data::formats());
QStringList list = files;
for (QStringList::Iterator it = list.begin(); it != list.end(); it++)
@ -1209,22 +1195,25 @@ void GUI::showGraphGrids(bool show)
void GUI::loadMap()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Open map file"),
QString(), tr("Map files (*.map *.tba *.tar)"));
QString(), MapList::formats());
if (fileName.isEmpty())
return;
if (_ml->loadMap(fileName)) {
QAction *a = new QAction(_ml->maps().last()->name(), this);
a->setCheckable(true);
a->setActionGroup(_mapsActionGroup);
_mapsSignalMapper->setMapping(a, _ml->maps().size() - 1);
connect(a, SIGNAL(triggered()), _mapsSignalMapper, SLOT(map()));
_mapActions.append(a);
_mapMenu->insertAction(_mapsEnd, a);
int count = _ml->maps().count();
if (_ml->loadFile(fileName)) {
for (int i = count; i < _ml->maps().count(); i++) {
QAction *a = new QAction(_ml->maps().at(i)->name(), this);
a->setCheckable(true);
a->setActionGroup(_mapsActionGroup);
_mapsSignalMapper->setMapping(a, i);
connect(a, SIGNAL(triggered()), _mapsSignalMapper, SLOT(map()));
_mapActions.append(a);
_mapMenu->insertAction(_mapsEnd, a);
}
_showMapAction->setEnabled(true);
_clearMapCacheAction->setEnabled(true);
a->activate(QAction::Trigger);
_mapActions.last()->activate(QAction::Trigger);
} else {
QString error = tr("Error loading map:") + "\n\n"
+ fileName + "\n\n" + _ml->errorString();

View File

@ -121,8 +121,6 @@ private:
void readSettings();
void writeSettings();
const QString fileFormats() const;
void keyPressEvent(QKeyEvent *event);
void closeEvent(QCloseEvent *event);
void dragEnterEvent(QDragEnterEvent *event);

View File

@ -120,7 +120,7 @@ bool IGCParser::readHRecord(const char *line, int len)
return true;
}
bool IGCParser::readBRecord(const char *line, int len)
bool IGCParser::readBRecord(TrackData &track, const char *line, int len)
{
qreal lat, lon, ele;
QTime time;
@ -156,12 +156,12 @@ bool IGCParser::readBRecord(const char *line, int len)
Trackpoint t(Coordinates(lon, lat));
t.setTimestamp(QDateTime(_date, _time, Qt::UTC));
t.setElevation(ele);
_tracks.last().append(t);
track.append(t);
return true;
}
bool IGCParser::readCRecord(const char *line, int len)
bool IGCParser::readCRecord(RouteData &route, const char *line, int len)
{
qreal lat, lon;
@ -183,14 +183,16 @@ bool IGCParser::readCRecord(const char *line, int len)
Waypoint w(Coordinates(lon, lat));
w.setName(QString(ba.trimmed()));
_routes.last().append(w);
route.append(w);
}
return true;
}
bool IGCParser::loadFile(QFile *file)
bool IGCParser::parse(QFile *file, QList<TrackData> &tracks,
QList<RouteData> &routes, QList<Waypoint> &waypoints)
{
Q_UNUSED(waypoints);
qint64 len;
char line[76 + 2 + 1 + 1];
bool route = false, track = false;
@ -221,11 +223,11 @@ bool IGCParser::loadFile(QFile *file)
return false;
} else if (line[0] == 'C') {
if (route) {
if (!readCRecord(line, len))
if (!readCRecord(routes.last() ,line, len))
return false;
} else {
route = true;
_routes.append(RouteData());
routes.append(RouteData());
}
} else if (line[0] == 'B') {
if (_date.isNull()) {
@ -233,11 +235,11 @@ bool IGCParser::loadFile(QFile *file)
return false;
}
if (!track) {
_tracks.append(TrackData());
tracks.append(TrackData());
_time = QTime(0, 0);
track = true;
}
if (!readBRecord(line, len))
if (!readBRecord(tracks.last(), line, len))
return false;
}
}

View File

@ -9,19 +9,18 @@
class IGCParser : public Parser
{
public:
IGCParser(QList<TrackData> &tracks, QList<RouteData> &routes,
QList<Waypoint> &waypoints) : Parser(tracks, routes, waypoints)
{_errorLine = 0;}
IGCParser() : _errorLine(0) {}
~IGCParser() {}
bool loadFile(QFile *file);
bool parse(QFile *file, QList<TrackData> &tracks,
QList<RouteData> &routes, QList<Waypoint> &waypoints);
QString errorString() const {return _errorString;}
int errorLine() const {return _errorLine;}
private:
bool readHRecord(const char *line, int len);
bool readBRecord(const char *line, int len);
bool readCRecord(const char *line, int len);
bool readBRecord(TrackData &track, const char *line, int len);
bool readCRecord(RouteData &route, const char *line, int len);
int _errorLine;
QString _errorString;

View File

@ -251,20 +251,21 @@ void KMLParser::track(TrackData &track)
_reader.raiseError(mismatchError);
}
void KMLParser::multiGeometry(const QString &name, const QString &desc,
void KMLParser::multiGeometry(QList<TrackData> &tracks,
QList<Waypoint> &waypoints, const QString &name, const QString &desc,
const QDateTime timestamp)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Point") {
_waypoints.append(Waypoint());
Waypoint &w = _waypoints.last();
waypoints.append(Waypoint());
Waypoint &w = waypoints.last();
w.setName(name);
w.setDescription(desc);
w.setTimestamp(timestamp);
point(w);
} else if (_reader.name() == "LineString") {
_tracks.append(TrackData());
TrackData &t = _tracks.last();
tracks.append(TrackData());
TrackData &t = tracks.last();
t.setName(name);
t.setDescription(desc);
lineString(t);
@ -273,7 +274,7 @@ void KMLParser::multiGeometry(const QString &name, const QString &desc,
}
}
void KMLParser::placemark()
void KMLParser::placemark(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
{
QString name, desc;
QDateTime timestamp;
@ -286,23 +287,23 @@ void KMLParser::placemark()
else if (_reader.name() == "TimeStamp")
timestamp = timeStamp();
else if (_reader.name() == "MultiGeometry")
multiGeometry(name, desc, timestamp);
multiGeometry(tracks, waypoints, name, desc, timestamp);
else if (_reader.name() == "Point") {
_waypoints.append(Waypoint());
Waypoint &w = _waypoints.last();
waypoints.append(Waypoint());
Waypoint &w = waypoints.last();
w.setName(name);
w.setDescription(desc);
w.setTimestamp(timestamp);
point(w);
} else if (_reader.name() == "LineString") {
_tracks.append(TrackData());
TrackData &t = _tracks.last();
tracks.append(TrackData());
TrackData &t = tracks.last();
t.setName(name);
t.setDescription(desc);
lineString(t);
} else if (_reader.name() == "Track") {
_tracks.append(TrackData());
TrackData &t = _tracks.last();
tracks.append(TrackData());
TrackData &t = tracks.last();
t.setName(name);
t.setDescription(desc);
track(t);
@ -311,58 +312,56 @@ void KMLParser::placemark()
}
}
void KMLParser::folder()
void KMLParser::folder(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Placemark")
placemark();
placemark(tracks, waypoints);
else if (_reader.name() == "Folder")
folder();
folder(tracks, waypoints);
else
_reader.skipCurrentElement();
}
}
void KMLParser::document()
void KMLParser::document(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Placemark")
placemark();
placemark(tracks, waypoints);
else if (_reader.name() == "Folder")
folder();
folder(tracks, waypoints);
else
_reader.skipCurrentElement();
}
}
void KMLParser::kml()
void KMLParser::kml(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Document")
document();
document(tracks, waypoints);
else if (_reader.name() == "Placemark")
placemark();
placemark(tracks, waypoints);
else
_reader.skipCurrentElement();
}
}
bool KMLParser::parse()
bool KMLParser::parse(QFile *file, QList<TrackData> &tracks,
QList<RouteData> &routes, QList<Waypoint> &waypoints)
{
Q_UNUSED(routes);
_reader.clear();
_reader.setDevice(file);
if (_reader.readNextStartElement()) {
if (_reader.name() == "kml")
kml();
kml(tracks, waypoints);
else
_reader.raiseError("Not a KML file");
}
return !_reader.error();
}
bool KMLParser::loadFile(QFile *file)
{
_reader.clear();
_reader.setDevice(file);
return parse();
}

View File

@ -8,22 +8,20 @@
class KMLParser : public Parser
{
public:
KMLParser(QList<TrackData> &tracks, QList<RouteData> &routes,
QList<Waypoint> &waypoints) : Parser(tracks, routes, waypoints) {}
~KMLParser() {}
bool loadFile(QFile *file);
bool parse(QFile *file, QList<TrackData> &tracks,
QList<RouteData> &routes, QList<Waypoint> &waypoints);
QString errorString() const {return _reader.errorString();}
int errorLine() const {return _reader.lineNumber();}
private:
bool parse();
void kml();
void document();
void folder();
void placemark();
void multiGeometry(const QString &name, const QString &desc,
const QDateTime timestamp);
void kml(QList<TrackData> &tracks, QList<Waypoint> &waypoints);
void document(QList<TrackData> &tracks, QList<Waypoint> &waypoints);
void folder(QList<TrackData> &tracks, QList<Waypoint> &waypoints);
void placemark(QList<TrackData> &tracks, QList<Waypoint> &waypoints);
void multiGeometry(QList<TrackData> &tracks, QList<Waypoint> &waypoints,
const QString &name, const QString &desc, const QDateTime timestamp);
void track(TrackData &track);
void lineString(TrackData &track);
void point(Waypoint &waypoint);

View File

@ -6,26 +6,25 @@
#include "maplist.h"
bool MapList::loadListEntry(const QByteArray &line)
Map *MapList::loadListEntry(const QByteArray &line)
{
QList<QByteArray> list = line.split('\t');
if (list.size() != 2)
return false;
return 0;
QByteArray ba1 = list[0].trimmed();
QByteArray ba2 = list[1].trimmed();
if (ba1.isEmpty() || ba2.isEmpty())
return false;
return 0;
_maps.append(new OnlineMap(QString::fromUtf8(ba1.data(), ba1.size()),
QString::fromLatin1(ba2.data(), ba2.size()), this));
return true;
return new OnlineMap(QString::fromUtf8(ba1.data(), ba1.size()),
QString::fromLatin1(ba2.data(), ba2.size()), this);
}
bool MapList::loadList(const QString &path)
{
QFile file(path);
QList<Map*> maps;
if (!file.open(QFile::ReadOnly | QFile::Text)) {
_errorString = file.errorString();
@ -36,65 +35,102 @@ bool MapList::loadList(const QString &path)
while (!file.atEnd()) {
ln++;
QByteArray line = file.readLine();
Map *map = loadListEntry(line);
if (!loadListEntry(line)) {
if (map)
maps.append(map);
else {
for (int i = 0; i < maps.count(); i++)
delete maps.at(i);
_errorString = QString("Invalid map list entry on line %1.")
.arg(QString::number(ln));
return false;
}
}
_maps += maps;
return true;
}
bool MapList::loadMap(const QString &path)
{
OfflineMap *map = new OfflineMap(path, this);
if (map->isValid()) {
_maps.append(map);
return true;
} else {
_errorString = map->errorString();
delete map;
return false;
}
}
bool MapList::loadTba(const QString &path)
{
Atlas *atlas = new Atlas(path, this);
if (atlas->isValid()) {
_maps.append(atlas);
return true;
} else {
_errorString = atlas->errorString();
delete atlas;
return false;
}
}
bool MapList::loadTar(const QString &path)
{
Atlas *atlas = new Atlas(path, this);
if (atlas->isValid()) {
_maps.append(atlas);
return true;
} else {
_errorString = atlas->errorString();
delete atlas;
OfflineMap *map = new OfflineMap(path, this);
if (map->isValid()) {
_maps.append(map);
return true;
} else {
qWarning("%s: %s", qPrintable(path), qPrintable(_errorString));
qWarning("%s: %s", qPrintable(path),
qPrintable(map->errorString()));
_errorString = "Not a map/atlas file";
delete map;
return false;
}
}
}
bool MapList::loadFile(const QString &path)
{
QFileInfo fi(path);
QString suffix = fi.suffix().toLower();
if (suffix == "map") {
OfflineMap *om = new OfflineMap(path, this);
if (om->isValid()) {
_maps.append(om);
return true;
} else {
_errorString = om->errorString();
delete om;
return false;
}
} else if (suffix == "tba") {
Atlas *atlas = new Atlas(path, this);
if (atlas->isValid()) {
_maps.append(atlas);
return true;
} else {
_errorString = atlas->errorString();
delete atlas;
return false;
}
} else if (suffix == "tar") {
Atlas *atlas = new Atlas(path, this);
if (atlas->isValid()) {
_maps.append(atlas);
return true;
} else {
_errorString = atlas->errorString();
delete atlas;
OfflineMap *om = new OfflineMap(path, this);
if (om->isValid()) {
_maps.append(om);
return true;
} else {
qWarning("%s: %s", qPrintable(path), qPrintable(_errorString));
qWarning("%s: %s", qPrintable(path),
qPrintable(om->errorString()));
_errorString = "Not a map/atlas file";
delete om;
return false;
}
}
} else {
if (suffix == "txt")
return loadList(path);
else if (suffix == "map")
return loadMap(path);
else if (suffix == "tba")
return loadTba(path);
else if (suffix == "tar")
return loadTar(path);
else {
_errorString = "Not a map/atlas file";
return false;
}
}
QString MapList::formats()
{
return tr("Map files (*.map *.tba *.tar)") + ";;"
+ tr("URL list files (*.txt)");
}
QStringList MapList::filter()
{
QStringList filter;
filter << "*.map" << "*.tba" << "*.tar" << "*.txt";
return filter;
}

View File

@ -12,14 +12,21 @@ class MapList : public QObject
public:
MapList(QObject *parent = 0) : QObject(parent) {}
bool loadMap(const QString &path);
bool loadList(const QString &path);
bool loadFile(const QString &path);
QList<Map*> &maps() {return _maps;}
const QList<Map*> &maps() const {return _maps;}
const QString &errorString() const {return _errorString;}
static QString formats();
static QStringList filter();
private:
bool loadListEntry(const QByteArray &line);
Map *loadListEntry(const QByteArray &line);
bool loadList(const QString &path);
bool loadMap(const QString &path);
bool loadTba(const QString &path);
bool loadTar(const QString &path);
QList<Map*> _maps;
QString _errorString;

View File

@ -227,7 +227,7 @@ bool NMEAParser::readEW(const char *data, int len, qreal &lon)
return true;
}
bool NMEAParser::readRMC(const char *line, int len)
bool NMEAParser::readRMC(TrackData &track, const char *line, int len)
{
int col = 1;
const char *vp = line;
@ -280,22 +280,23 @@ bool NMEAParser::readRMC(const char *line, int len)
}
if (!date.isNull()) {
if (_date.isNull() && !_time.isNull() && !_tracks.last().isEmpty())
_tracks.last().last().setTimestamp(QDateTime(date, _time, Qt::UTC));
if (_date.isNull() && !_time.isNull() && !track.isEmpty())
track.last().setTimestamp(QDateTime(date, _time, Qt::UTC));
_date = date;
}
if (valid && !_GGA && !std::isnan(lat) && !std::isnan(lon)) {
Trackpoint t(Coordinates(lon, lat));
Coordinates c(lon, lat);
if (valid && !_GGA && c.isValid()) {
Trackpoint t(c);
if (!_date.isNull() && !time.isNull())
t.setTimestamp(QDateTime(_date, time, Qt::UTC));
_tracks.last().append(t);
track.append(t);
}
return true;
}
bool NMEAParser::readGGA(const char *line, int len)
bool NMEAParser::readGGA(TrackData &track, const char *line, int len)
{
int col = 1;
const char *vp = line;
@ -356,13 +357,14 @@ bool NMEAParser::readGGA(const char *line, int len)
return false;
}
if (!std::isnan(lat) && !std::isnan(lon)) {
Trackpoint t(Coordinates(lon, lat));
Coordinates c(lon, lat);
if (c.isValid()) {
Trackpoint t(c);
if (!(_time.isNull() || _date.isNull()))
t.setTimestamp(QDateTime(_date, _time, Qt::UTC));
if (!std::isnan(ele))
t.setElevation(ele - gh);
_tracks.last().append(t);
track.append(t);
_GGA = true;
}
@ -370,7 +372,7 @@ bool NMEAParser::readGGA(const char *line, int len)
return true;
}
bool NMEAParser::readWPL(const char *line, int len)
bool NMEAParser::readWPL(QList<Waypoint> &waypoints, const char *line, int len)
{
int col = 1;
const char *vp = line;
@ -411,10 +413,11 @@ bool NMEAParser::readWPL(const char *line, int len)
return false;
}
if (!std::isnan(lat) && !std::isnan(lon)) {
Waypoint w(Coordinates(lon, lat));
Coordinates c(lon, lat);
if (c.isValid()) {
Waypoint w(c);
w.setName(name);
_waypoints.append(w);
waypoints.append(w);
}
return true;
@ -474,8 +477,10 @@ bool NMEAParser::readZDA(const char *line, int len)
return true;
}
bool NMEAParser::loadFile(QFile *file)
bool NMEAParser::parse(QFile *file, QList<TrackData> &tracks,
QList<RouteData> &routes, QList<Waypoint> &waypoints)
{
Q_UNUSED(routes);
qint64 len;
char line[80 + 2 + 1 + 1];
@ -486,7 +491,8 @@ bool NMEAParser::loadFile(QFile *file)
_time = QTime();
_GGA = false;
_tracks.append(TrackData());
tracks.append(TrackData());
TrackData &track = tracks.last();
while (!file->atEnd()) {
len = file->readLine(line, sizeof(line));
@ -501,13 +507,13 @@ bool NMEAParser::loadFile(QFile *file)
if (validSentence(line, len)) {
if (!memcmp(line + 3, "RMC,", 4)) {
if (!readRMC(line + 7, len))
if (!readRMC(track, line + 7, len))
return false;
} else if (!memcmp(line + 3, "GGA,", 4)) {
if (!readGGA(line + 7, len))
if (!readGGA(track, line + 7, len))
return false;
} else if (!memcmp(line + 3, "WPL,", 4)) {
if (!readWPL(line + 7, len))
if (!readWPL(waypoints, line + 7, len))
return false;
} else if (!memcmp(line + 3, "ZDA,", 4)) {
if (!readZDA(line + 7, len))
@ -518,7 +524,7 @@ bool NMEAParser::loadFile(QFile *file)
_errorLine++;
}
if (!_tracks.last().size() && !_waypoints.size()) {
if (!tracks.last().size() && !waypoints.size()) {
_errorString = "No usable NMEA sentence found";
return false;
}

View File

@ -8,12 +8,11 @@
class NMEAParser : public Parser
{
public:
NMEAParser(QList<TrackData> &tracks, QList<RouteData> &routes,
QList<Waypoint> &waypoints) : Parser(tracks, routes, waypoints)
{_errorLine = 0; _GGA = false;}
NMEAParser() : _errorLine(0), _GGA(false) {}
~NMEAParser() {}
bool loadFile(QFile *file);
bool parse(QFile *file, QList<TrackData> &tracks,
QList<RouteData> &routes, QList<Waypoint> &waypoints);
QString errorString() const {return _errorString;}
int errorLine() const {return _errorLine;}
@ -27,9 +26,9 @@ private:
bool readAltitude(const char *data, int len, qreal &ele);
bool readGeoidHeight(const char *data, int len, qreal &gh);
bool readRMC(const char *line, int len);
bool readGGA(const char *line, int len);
bool readWPL(const char *line, int len);
bool readRMC(TrackData &track, const char *line, int len);
bool readGGA(TrackData &track, const char *line, int len);
bool readWPL(QList<Waypoint> &waypoints, const char *line, int len);
bool readZDA(const char *line, int len);
int _errorLine;

View File

@ -12,19 +12,12 @@
class Parser
{
public:
Parser(QList<TrackData> &tracks, QList<RouteData> &routes,
QList<Waypoint> &waypoints) : _tracks(tracks), _routes(routes),
_waypoints(waypoints) {}
virtual ~Parser() {}
virtual bool loadFile(QFile *file) = 0;
virtual bool parse(QFile *file, QList<TrackData> &tracks,
QList<RouteData> &routes, QList<Waypoint> &waypoints) = 0;
virtual QString errorString() const = 0;
virtual int errorLine() const = 0;
protected:
QList<TrackData> &_tracks;
QList<RouteData> &_routes;
QList<Waypoint> &_waypoints;
};
#endif // PARSER_H

View File

@ -22,7 +22,7 @@
#define SCALE_OFFSET 7
PathView::PathView(Map *map, POI *poi, QWidget *parent)
: QGraphicsView(parent)
: QGraphicsView(parent)
{
Q_ASSERT(map != 0);
Q_ASSERT(poi != 0);

View File

@ -131,7 +131,7 @@ void TCXParser::lap(TrackData &track)
}
}
void TCXParser::course(TrackData &track)
void TCXParser::course(QList<Waypoint> &waypoints, TrackData &track)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Track")
@ -144,7 +144,7 @@ void TCXParser::course(TrackData &track)
Waypoint w;
waypointData(w);
if (w.coordinates().isValid())
_waypoints.append(w);
waypoints.append(w);
else
warning("Missing Trackpoint coordinates");
} else
@ -162,56 +162,54 @@ void TCXParser::activity(TrackData &track)
}
}
void TCXParser::courses()
void TCXParser::courses(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Course") {
_tracks.append(TrackData());
course(_tracks.back());
tracks.append(TrackData());
course(waypoints, tracks.back());
} else
_reader.skipCurrentElement();
}
}
void TCXParser::activities()
void TCXParser::activities(QList<TrackData> &tracks)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Activity") {
_tracks.append(TrackData());
activity(_tracks.back());
tracks.append(TrackData());
activity(tracks.back());
} else
_reader.skipCurrentElement();
}
}
void TCXParser::tcx()
void TCXParser::tcx(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Courses")
courses();
courses(tracks, waypoints);
else if (_reader.name() == "Activities")
activities();
activities(tracks);
else
_reader.skipCurrentElement();
}
}
bool TCXParser::parse()
bool TCXParser::parse(QFile *file, QList<TrackData> &tracks,
QList<RouteData> &routes, QList<Waypoint> &waypoints)
{
Q_UNUSED(routes);
_reader.clear();
_reader.setDevice(file);
if (_reader.readNextStartElement()) {
if (_reader.name() == "TrainingCenterDatabase")
tcx();
tcx(tracks, waypoints);
else
_reader.raiseError("Not a TCX file");
}
return !_reader.error();
}
bool TCXParser::loadFile(QFile *file)
{
_reader.clear();
_reader.setDevice(file);
return parse();
}

View File

@ -8,20 +8,18 @@
class TCXParser : public Parser
{
public:
TCXParser(QList<TrackData> &tracks, QList<RouteData> &routes,
QList<Waypoint> &waypoints) : Parser(tracks, routes, waypoints) {}
~TCXParser() {}
bool loadFile(QFile *file);
bool parse(QFile *file, QList<TrackData> &tracks,
QList<RouteData> &routes, QList<Waypoint> &waypoints);
QString errorString() const {return _reader.errorString();}
int errorLine() const {return _reader.lineNumber();}
private:
bool parse();
void tcx();
void courses();
void activities();
void course(TrackData &track);
void tcx(QList<TrackData> &tracks, QList<Waypoint> &waypoints);
void courses(QList<TrackData> &tracks, QList<Waypoint> &waypoints);
void activities(QList<TrackData> &tracks);
void course(QList<Waypoint> &waypoints, TrackData &track);
void activity(TrackData &track);
void lap(TrackData &track);
void trackpoints(TrackData &track);