diff --git a/src/data.cpp b/src/data.cpp index ae43e942..93395e54 100644 --- a/src/data.cpp +++ b/src/data.cpp @@ -11,21 +11,30 @@ #include "data.h" +static GPXParser gpx; +static TCXParser tcx; +static KMLParser kml; +static FITParser fit; +static CSVParser csv; +static IGCParser igc; +static NMEAParser nmea; + static QHash parsers() { 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()); + hash.insert("gpx", &gpx); + hash.insert("tcx", &tcx); + hash.insert("kml", &kml); + hash.insert("fit", &fit); + hash.insert("csv", &csv); + hash.insert("igc", &igc); + hash.insert("nmea", &nmea); return hash; } + QHash Data::_parsers = parsers(); Data::~Data()