diff --git a/lang/gpxsee_cs.ts b/lang/gpxsee_cs.ts
index 4d8860ad..1f0bf905 100644
--- a/lang/gpxsee_cs.ts
+++ b/lang/gpxsee_cs.ts
@@ -25,6 +25,54 @@
Maximum
+
+ Data
+
+
+ Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)
+ Podporované soubory (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)
+
+
+
+ CSV files (*.csv)
+ Soubory CSV (*.csv)
+
+
+
+ FIT files (*.fit)
+ Soubory FIT (*.fit)
+
+
+
+ GPX files (*.gpx)
+ Soubory GPX (*.gpx)
+
+
+
+ IGC files (*.igc)
+ Soubory IGC (*.igc)
+
+
+
+ KML files (*.kml)
+ Soubory KML (*.kml)
+
+
+
+ NMEA files (*.nmea)
+ Soubory NMEA (*.nmea)
+
+
+
+ TCX files (*.tcx)
+ Soubory TCX (*.tcx)
+
+
+
+ All files (*)
+ Všechny soubory (*)
+
+
ElevationGraph
@@ -190,366 +238,321 @@
GUI
-
+
GPXSee is distributed under the terms of the GNU General Public License version 3. For more info about GPXSee visit the project homepage at
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
-
+
Open file
Otevřít soubor
-
+
Open POI file
Otevřít POI soubor
-
+
Quit
Ukončit
-
-
-
+
+
+
Keyboard controls
Ovládací klávesy
-
+
Close
Zavřít
-
+
Reload
Znovu načíst
-
+
Show
Zobrazit
-
-
+
+
File
Soubor
-
- FIT files (*.fit)
- Soubory FIT (*.fit)
-
-
-
- IGC files (*.igc)
- Soubory IGC (*.igc)
-
-
-
- NMEA files (*.nmea)
- Soubory NMEA (*.nmea)
-
-
-
-
-
+
+
+
Data sources
Zdroje dat
-
+
Close POI files
Zavřit POI soubory
-
+
Overlap POIs
Překrývat POI
-
+
Show POI labels
Zobrazit názvy POI
-
+
Show POIs
Zobrazit POI
-
+
Show map
Zobrazit mapu
-
+
Clear tile cache
Vymazat mezipaměť dlaždic
-
+
Open...
Otevřít...
-
+
Load POI file...
Nahrát POI soubor...
-
+
Load map...
Nahrát mapu...
-
-
-
+
+
+
Next map
Následující mapa
-
+
Show tracks
Zobrazit cesty
-
+
Show routes
Zobrazit trasy
-
+
Show waypoints
Zobrazit navigační body
-
+
Waypoint labels
Názvy navigačních bodů
-
+
Show graphs
Zobrazit grafy
-
+
Show grid
Zobrazit mřížku
-
+
Show toolbars
Zobrazovat nástrojové lišty
-
+
Total time
Celkový čas
-
-
+
+
Moving time
Čistý čas
-
+
Metric
Metrické
-
+
Imperial
Imperiální
-
+
Fullscreen mode
Celoobrazovkový režim
-
+
Options...
Nastavení...
-
+
Next
Následující
-
+
Previous
Předchozí
-
+
Last
Poslední
-
+
First
První
-
+
Map
Mapa
-
+
Graph
Graf
-
+
POI
POI
-
+
POI files
POI soubory
-
+
Data
Data
-
+
Display
Zobrazit
-
+
Settings
Nastavení
-
+
Units
Jednotky
-
+
Help
Nápověda
-
+
Append file
Přidat soubor
-
+
Next/Previous
Následující/Předchozí
-
+
Previous map
Předchozí mapa
-
+
Zoom in
Přiblížit
-
+
Zoom out
Oddálit
-
+
Digital zoom
Digitální zoom
-
+
Zoom
Zoom
-
+
Online maps
Online mapy
-
+
Online map URLs are read on program startup from the following file:
URL online map jsou načteny při startu programu z následujícího souboru:
-
+
Offline maps are loaded on program startup from the following directory:
Offline mapy jsou načítány při startu aplikace z následujícího adresáře:
-
+
Open map file
Otevřít mapový soubor
-
+
No files loaded
Nejsou načteny žádné soubory
-
- GPX files (*.gpx)
- Soubory GPX (*.gpx)
-
-
-
- TCX files (*.tcx)
- Soubory TCX (*.tcx)
-
-
-
- KML files (*.kml)
- Soubory KML (*.kml)
-
-
-
- CSV files (*.csv)
- Soubory CSV (*.csv)
-
-
-
- All files (*)
- Všechny soubory (*)
-
-
-
-
+
+
Date
Datum
-
+
Routes
Trasy
-
- Map files (*.map *.tba *.tar)
- Mapové soubory (*.map *.tba *.tar)
-
-
-
+
Error loading map:
Mapu nelze načíst:
-
+
%n files
%n soubor
@@ -558,127 +561,122 @@
-
+
Next file
Následující soubor
-
+
Version
Verze
-
+
Print...
Tisknout...
-
+
Export to PDF...
Exportovat do PDF...
-
+
Waypoints
Navigační body
-
+
Previous file
Předchozí soubor
-
- Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)
- Podporované soubory (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)
-
-
-
+
Route waypoints
Body tras
-
+
First file
První soubor
-
+
Last file
Poslední soubor
-
+
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:
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:
-
+
Offline maps
Offline mapy
-
+
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).
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).
-
+
To make GPXSee load a POI file automatically on startup, add the file to the following directory:
POI soubory, které se mají automaticky nahrát při startu programu jsou načítány z následujícího adresáře:
-
+
Error loading data file:
Datový soubor nelze načíst:
-
-
+
+
Line: %1
Řádka: %1
-
+
Error loading POI file:
Soubor POI nelze načíst:
-
+
Name
Název
-
+
Tracks
Cesty
-
-
+
+
About GPXSee
O aplikaci GPXSee
-
+
Navigation
Navigace
-
+
POIs
POI body
-
-
+
+
Distance
Vzdálenost
-
-
-
+
+
+
Time
Čas
@@ -756,6 +754,19 @@
Maximum
+
+ MapList
+
+
+ Map files (*.map *.tba *.tar)
+ Mapové soubory (*.map *.tba *.tar)
+
+
+
+ URL list files (*.txt)
+ Seznamy URL (*.txt)
+
+
OptionsDialog
diff --git a/lang/gpxsee_de.ts b/lang/gpxsee_de.ts
index 2fc5af3a..93c81a8e 100644
--- a/lang/gpxsee_de.ts
+++ b/lang/gpxsee_de.ts
@@ -25,6 +25,54 @@
Maximum
+
+ Data
+
+
+ Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)
+ Unterstütze Dateien (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)
+
+
+
+ CSV files (*.csv)
+ CSV-Dateien (*.csv)
+
+
+
+ FIT files (*.fit)
+ FIT-Dateien (*.fit)
+
+
+
+ GPX files (*.gpx)
+ GPX-Dateien (*.gpx)
+
+
+
+ IGC files (*.igc)
+ IGC-Dateien (*.igc)
+
+
+
+ KML files (*.kml)
+ KML-Dateien (*.kml)
+
+
+
+ NMEA files (*.nmea)
+ NMEA-Dateien (*.nmea)
+
+
+
+ TCX files (*.tcx)
+ TCX-Dateien (*.tcx)
+
+
+
+ All files (*)
+ Alle Dateien (*)
+
+
ElevationGraph
@@ -190,335 +238,315 @@
GUI
-
+
GPXSee is distributed under the terms of the GNU General Public License version 3. For more info about GPXSee visit the project homepage at
GPXSee wird unter der GNU General Public License version 3 vertrieben. Mehr Informationen zu GPXSee auf der Homepage
-
+
Open file
Datei öffnen
-
+
Open POI file
POI Datei öffnen
-
+
Quit
Beenden
-
-
-
+
+
+
Keyboard controls
Tastaturkürzel
-
+
Close
Schließen
-
+
Reload
Neu Laden
-
+
Show
Ansicht
-
-
+
+
File
Datei
-
- FIT files (*.fit)
- FIT-Dateien (*.fit)
-
-
-
- IGC files (*.igc)
- IGC-Dateien (*.igc)
-
-
-
- NMEA files (*.nmea)
- NMEA-Dateien (*.nmea)
-
-
-
-
-
+
+
+
Data sources
Datenquellen
-
+
Close POI files
POI-Datei schließen
-
+
Overlap POIs
POI überlappen
-
+
Show POI labels
POI-Labels anzeigen
-
+
Show POIs
POIs anzeigen
-
+
Show map
Karte anzeigen
-
+
Clear tile cache
Tile-Cache bereinigen
-
+
Open...
Öffnen...
-
+
Load POI file...
POI-Datei laden...
-
+
Load map...
Karte laden...
-
-
-
+
+
+
Next map
Nächste Karte
-
+
Show tracks
Strecken anzeigen
-
+
Show routes
Routen anzeigen
-
+
Show waypoints
Wegpunkte anzeigen
-
+
Waypoint labels
Wegpunkt Labels
-
+
Show graphs
Graphen anzeigen
-
+
Show grid
Gitter anzeigen
-
+
Show toolbars
Toolbars anzeigen
-
+
Total time
Gesamtzeit
-
-
+
+
Moving time
Bewegungszeit
-
+
Metric
Metrisch
-
+
Imperial
Imperial
-
+
Fullscreen mode
Vollbildmodus
-
+
Options...
Einstellungen...
-
+
Next
Nächste
-
+
Previous
Vorherige
-
+
Last
Letzte
-
+
First
Erste
-
+
Map
Karte
-
+
Graph
Graph
-
+
POI
POI
-
+
POI files
POI-Dateien
-
+
Data
Daten
-
+
Display
Anzeige
-
+
Settings
Einstellungen
-
+
Units
Einheiten
-
+
Help
Hilfe
-
+
Append file
An Datei anhängen
-
+
Next/Previous
Nächste/Vorherige
-
+
Previous map
Vorherige Karte
-
+
Zoom in
Hineinzoomen
-
+
Zoom out
Herauszoomen
-
+
Digital zoom
Digitaler Zoom
-
+
Zoom
Zoom
-
+
Online maps
Onlinekarten
-
+
Online map URLs are read on program startup from the following file:
Onlinekarten URLs werden zu Programmstart aus der folgenden Datei gelesen:
-
+
Offline maps
Offlinekarten
-
+
Offline maps are loaded on program startup from the following directory:
Offlinekarten werden zu Programmstart aus dem folgenden Verzeichnis geladen:
-
+
Open map file
Karte Datei öffnen
-
- Map files (*.map *.tba *.tar)
- Karten-Dateien (*.map *.tba *.tar)
-
-
-
+
Error loading map:
Fehler beim Laden der Karte-Datei:
-
+
No files loaded
Keine Dateien geladen
-
+
%n files
%n Datei
@@ -526,158 +554,128 @@
-
- GPX files (*.gpx)
- GPX-Dateien (*.gpx)
-
-
-
- TCX files (*.tcx)
- TCX-Dateien (*.tcx)
-
-
-
- KML files (*.kml)
- KML-Dateien (*.kml)
-
-
-
- CSV files (*.csv)
- CSV-Dateien (*.csv)
-
-
-
- All files (*)
- Alle Dateien (*)
-
-
-
-
+
+
Date
Datum
-
+
Routes
Routen
-
+
Next file
Nächste Datei
-
+
Version
Version
-
+
Print...
Drucken...
-
+
Export to PDF...
Als PDF exportieren...
-
+
Waypoints
Wegpunkte
-
+
Previous file
Vorherige Datei
-
- Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)
- Unterstütze Dateien (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)
-
-
-
+
Route waypoints
Routen Wegpunkte
-
+
First file
Erste Datei
-
+
Last file
Letzte Datei
-
+
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:
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:
-
+
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).
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).
-
+
To make GPXSee load a POI file automatically on startup, add the file to the following directory:
Damit GPXSee zu Programmstart automatisch eine POI-Datei lädt, fügen Sie diese zu folgendem Verzeichnis hinzu:
-
+
Error loading data file:
Fehler beim Laden der Datei:
-
-
+
+
Line: %1
Linie: %1
-
+
Error loading POI file:
Fehler beim Laden der POI-Datei:
-
+
Name
Name
-
+
Tracks
Strecken
-
-
+
+
About GPXSee
Über GPXSee
-
+
Navigation
Navigation
-
+
POIs
POIs
-
-
+
+
Distance
Distanz
-
-
-
+
+
+
Time
Zeit
@@ -755,6 +753,19 @@
Maximum
+
+ MapList
+
+
+ Map files (*.map *.tba *.tar)
+ Karten-Dateien (*.map *.tba *.tar)
+
+
+
+ URL list files (*.txt)
+
+
+
OptionsDialog
diff --git a/lang/gpxsee_sv.ts b/lang/gpxsee_sv.ts
index 060cf850..68123956 100644
--- a/lang/gpxsee_sv.ts
+++ b/lang/gpxsee_sv.ts
@@ -1,6 +1,6 @@
-
+
CadenceGraph
@@ -25,6 +25,54 @@
Maximal
+
+ Data
+
+
+ Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)
+ Filer som stöds (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)
+
+
+
+ CSV files (*.csv)
+ CSV-filer (*.csv)
+
+
+
+ FIT files (*.fit)
+ FIT-filer (*.fit)
+
+
+
+ GPX files (*.gpx)
+ GPX-filer (*.gpx)
+
+
+
+ IGC files (*.igc)
+ IGC-filer (*.igc)
+
+
+
+ KML files (*.kml)
+ KML-filer (*.kml)
+
+
+
+ NMEA files (*.nmea)
+ NMEA-filer (*.nmea)
+
+
+
+ TCX files (*.tcx)
+ TCX-filer (*.tcx)
+
+
+
+ All files (*)
+ Alla filer (*)
+
+
ElevationGraph
@@ -190,335 +238,315 @@
GUI
-
+
GPXSee is distributed under the terms of the GNU General Public License version 3. For more info about GPXSee visit the project homepage at
GPXSee distribueras under vilkoren för GNU General Public License version 3. För mer info om GPXSee, besök hemsidan på
-
+
Open file
Öppna fil
-
+
Open POI file
Öppna POI-fil
-
+
Quit
Avsluta
-
-
-
+
+
+
Keyboard controls
Snabbtangenter
-
+
Close
Stäng
-
+
Reload
Uppdatera
-
+
Show
Visa
-
-
+
+
File
Arkiv
-
- FIT files (*.fit)
- FIT-filer (*.fit)
-
-
-
- IGC files (*.igc)
- IGC-filer (*.igc)
-
-
-
- NMEA files (*.nmea)
- NMEA-filer (*.nmea)
-
-
-
-
-
+
+
+
Data sources
Datakällor
-
+
Close POI files
Stäng POI-filer
-
+
Overlap POIs
Överlappa POI:er
-
+
Show POI labels
Visa POI-namn
-
+
Show POIs
Visa POI:er
-
+
Show map
Visa karta
-
+
Clear tile cache
Rensa kart-cache
-
+
Open...
Öppna...
-
+
Load POI file...
Läs in POI-fil...
-
+
Load map...
Läs in karta...
-
-
-
+
+
+
Next map
Nästa karta
-
+
Show tracks
Visa spår
-
+
Show routes
Visa rutter
-
+
Show waypoints
Visa vägpunkter
-
+
Waypoint labels
Vägpunktsnamn
-
+
Show graphs
Visa diagram
-
+
Show grid
Visa stödlinjer
-
+
Show toolbars
Visa verktygsfält
-
+
Total time
Total tid
-
-
+
+
Moving time
Förflyttningstid
-
+
Metric
Meter
-
+
Imperial
Imperial
-
+
Fullscreen mode
Helskärmsläge
-
+
Options...
Alternativ...
-
+
Next
Nästa
-
+
Previous
Föregående
-
+
Last
Sista
-
+
First
Första
-
+
Map
Karta
-
+
Graph
Diagram
-
+
POI
POI
-
+
POI files
POI-filer
-
+
Data
Data
-
+
Display
Visa
-
+
Settings
Inställningar
-
+
Units
Enhet
-
+
Help
Hjälp
-
+
Append file
Lägg till fil
-
+
Next/Previous
Nästa/Föregående
-
+
Previous map
Föregående karta
-
+
Zoom in
Zooma in
-
+
Zoom out
Zooma ut
-
+
Digital zoom
Digital zoom
-
+
Zoom
Zoom
-
+
Online maps
Online-kartor
-
+
Online map URLs are read on program startup from the following file:
Online-kartors URL:er, läses från följande fil vid programstart:
-
+
Offline maps
Offline-kartor
-
+
Offline maps are loaded on program startup from the following directory:
Offline-kartor läses in från följande mapp vid programstart:
-
+
Open map file
Öppna kartfil
-
- Map files (*.map *.tba *.tar)
- Kartfiler (*.map *.tba *.tar)
-
-
-
+
Error loading map:
Fel vid inläsning av karta:
-
+
No files loaded
Inga filer inlästa
-
+
%n files
%n filer
@@ -526,158 +554,128 @@
-
- GPX files (*.gpx)
- GPX-filer (*.gpx)
-
-
-
- TCX files (*.tcx)
- TCX-filer (*.tcx)
-
-
-
- KML files (*.kml)
- KML-filer (*.kml)
-
-
-
- CSV files (*.csv)
- CSV-filer (*.csv)
-
-
-
- All files (*)
- Alla filer (*)
-
-
-
-
+
+
Date
Datum
-
+
Routes
Rutter
-
+
Next file
Nästa fil
-
+
Version
Version
-
+
Print...
Skriv ut...
-
+
Export to PDF...
Exportera till PDF...
-
+
Waypoints
Vägpunkter
-
+
Previous file
Föregående fil
-
- Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)
- Filer som stöds (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)
-
-
-
+
Route waypoints
Ruttvägpunkter
-
+
First file
Första filen
-
+
Last file
Sista filen
-
+
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:
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 på en kartfil kan se ut så här:
-
+
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).
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).
-
+
To make GPXSee load a POI file automatically on startup, add the file to the following directory:
För att GPXSee skall läsa in en POI-fil automatiskt vid programstart, läggs filen i följande mapp:
-
+
Error loading data file:
Fel vid inläsning av datafil:
-
-
+
+
Line: %1
Rad: %1
-
+
Error loading POI file:
Fel vid inläsning av POI-fil:
-
+
Name
Namn
-
+
Tracks
Spår
-
-
+
+
About GPXSee
Om GPXSee
-
+
Navigation
Navigation
-
+
POIs
POI:er
-
-
+
+
Distance
Avstånd
-
-
-
+
+
+
Time
Tid
@@ -755,6 +753,19 @@
Max
+
+ MapList
+
+
+ Map files (*.map *.tba *.tar)
+ Kartfiler (*.map *.tba *.tar)
+
+
+
+ URL list files (*.txt)
+
+
+
OptionsDialog
diff --git a/src/csvparser.cpp b/src/csvparser.cpp
index 9987646d..f4298bbc 100644
--- a/src/csvparser.cpp
+++ b/src/csvparser.cpp
@@ -1,7 +1,10 @@
#include "csvparser.h"
-bool CSVParser::loadFile(QFile *file)
+bool CSVParser::parse(QFile *file, QList &track,
+ QList &routes, QList &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++;
}
diff --git a/src/csvparser.h b/src/csvparser.h
index 36b5c47a..9c840ae2 100644
--- a/src/csvparser.h
+++ b/src/csvparser.h
@@ -6,12 +6,11 @@
class CSVParser : public Parser
{
public:
- CSVParser(QList &tracks, QList &routes,
- QList &waypoints) : Parser(tracks, routes, waypoints)
- {_errorLine = 0;}
+ CSVParser() : _errorLine(0) {}
~CSVParser() {}
- bool loadFile(QFile *file);
+ bool parse(QFile *file, QList &track, QList &routes,
+ QList &waypoints);
QString errorString() const {return _errorString;}
int errorLine() const {return _errorLine;}
diff --git a/src/data.cpp b/src/data.cpp
index 469dda45..ae43e942 100644
--- a/src/data.cpp
+++ b/src/data.cpp
@@ -11,38 +11,32 @@
#include "data.h"
-Data::Data() : _errorLine(0)
+static QHash 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 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 Data::_parsers = parsers();
+
Data::~Data()
{
- QHash::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::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::iterator it;
+
+ for (it = _parsers.begin(); it != _parsers.end(); it++)
+ filter << QString("*.%1").arg(it.key());
+
+ return filter;
+}
diff --git a/src/data.h b/src/data.h
index ecf7abbc..080ab0e9 100644
--- a/src/data.h
+++ b/src/data.h
@@ -6,16 +6,19 @@
#include
#include
#include
+#include
#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