QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsbabelformatregistry.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsbabelformatregistry.cpp
3  -------------------
4  begin : July 2021
5  copyright : (C) 2021 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "qgsbabelformatregistry.h"
19 #include "qgsbabelformat.h"
20 #include "qgsbabelgpsdevice.h"
21 #include "qgssettings.h"
22 #include <QString>
23 #include <QRegularExpression>
24 
26 {
27  //
28  // this list is automatically generated by scripts/dump_babel_formats.py
29  //
30  mImporters[QStringLiteral( "alantrl" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "alantrl" ), QStringLiteral( "Alan Map500 tracklogs (.trl)" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "trl" )} );
31  mImporters[QStringLiteral( "alanwpr" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "alanwpr" ), QStringLiteral( "Alan Map500 waypoints and routes (.wpr)" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes, {QStringLiteral( "wpr" )} );
32  mImporters[QStringLiteral( "an1" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "an1" ), QStringLiteral( "DeLorme .an1 (drawing) file" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes, {QStringLiteral( "an1" )} );
33  mImporters[QStringLiteral( "arc" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "arc" ), QStringLiteral( "GPSBabel arc filter file" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "txt" )} );
34  mImporters[QStringLiteral( "bcr" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "bcr" ), QStringLiteral( "Motorrad Routenplaner (Map&Guide) .bcr files" ), Qgis::BabelFormatCapability::Routes, {QStringLiteral( "bcr" )} );
35  mImporters[QStringLiteral( "bushnell" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "bushnell" ), QStringLiteral( "Bushnell GPS Waypoint file" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "wpt" )} );
36  mImporters[QStringLiteral( "bushnell_trl" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "bushnell_trl" ), QStringLiteral( "Bushnell GPS Trail file" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "trl" )} );
37  mImporters[QStringLiteral( "cambridge" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "cambridge" ), QStringLiteral( "Cambridge/Winpilot glider software" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "dat" )} );
38  mImporters[QStringLiteral( "compegps" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "compegps" ), QStringLiteral( "CompeGPS data files (.wpt/.trk/.rte)" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {} );
39  mImporters[QStringLiteral( "cst" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "cst" ), QStringLiteral( "CarteSurTable data file" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "cst" )} );
40  mImporters[QStringLiteral( "csv" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "csv" ), QStringLiteral( "Comma separated values" ), Qgis::BabelFormatCapability::Waypoints, {} );
41  mImporters[QStringLiteral( "cup" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "cup" ), QStringLiteral( "See You flight analysis data" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "cup" )} );
42  mImporters[QStringLiteral( "destinator_itn" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "destinator_itn" ), QStringLiteral( "Destinator Itineraries (.dat)" ), Qgis::BabelFormatCapability::Routes, {QStringLiteral( "dat" )} );
43  mImporters[QStringLiteral( "destinator_poi" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "destinator_poi" ), QStringLiteral( "Destinator Points of Interest (.dat)" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "dat" )} );
44  mImporters[QStringLiteral( "destinator_trl" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "destinator_trl" ), QStringLiteral( "Destinator TrackLogs (.dat)" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "dat" )} );
45  mImporters[QStringLiteral( "dmtlog" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "dmtlog" ), QStringLiteral( "TrackLogs digital mapping (.trl)" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "trl" )} );
46  mImporters[QStringLiteral( "dna" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "dna" ), QStringLiteral( "Navitrak DNA marker format" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "dna" )} );
47  mImporters[QStringLiteral( "easygps" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "easygps" ), QStringLiteral( "EasyGPS binary format" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "loc" )} );
48  mImporters[QStringLiteral( "energympro" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "energympro" ), QStringLiteral( "Energympro GPS training watch" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "cpo" )} );
49  mImporters[QStringLiteral( "enigma" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "enigma" ), QStringLiteral( "Enigma binary waypoint file (.ert)" ), Qgis::BabelFormatCapability::Routes, {QStringLiteral( "ert" )} );
50  mImporters[QStringLiteral( "exif" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "exif" ), QStringLiteral( "Embedded Exif-GPS data (.jpg)" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "jpg" )} );
51  mImporters[QStringLiteral( "f90g" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "f90g" ), QStringLiteral( "F90G Automobile DVR GPS log file" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "map" )} );
52  mImporters[QStringLiteral( "flysight" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "flysight" ), QStringLiteral( "FlySight GPS File" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "csv" )} );
53  mImporters[QStringLiteral( "fugawi" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "fugawi" ), QStringLiteral( "Fugawi" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "txt" )} );
54  mImporters[QStringLiteral( "g7towin" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "g7towin" ), QStringLiteral( "G7ToWin data files (.g7t)" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "g7t" )} );
55  mImporters[QStringLiteral( "garmin301" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "garmin301" ), QStringLiteral( "Garmin 301 Custom position and heartrate" ), Qgis::BabelFormatCapability::Waypoints, {} );
56  mImporters[QStringLiteral( "garmin_fit" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "garmin_fit" ), QStringLiteral( "Flexible and Interoperable Data Transfer (FIT) Activity file" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "fit" )} );
57  mImporters[QStringLiteral( "garmin_g1000" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "garmin_g1000" ), QStringLiteral( "Garmin G1000 datalog input filter file" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "csv" )} );
58  mImporters[QStringLiteral( "garmin_gpi" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "garmin_gpi" ), QStringLiteral( "Garmin Points of Interest (.gpi)" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "gpi" )} );
59  mImporters[QStringLiteral( "garmin_poi" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "garmin_poi" ), QStringLiteral( "Garmin POI database" ), Qgis::BabelFormatCapability::Waypoints, {} );
60  mImporters[QStringLiteral( "garmin_txt" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "garmin_txt" ), QStringLiteral( "Garmin MapSource - txt (tab delimited)" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "txt" )} );
61  mImporters[QStringLiteral( "garmin_xt" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "garmin_xt" ), QStringLiteral( "Mobile Garmin XT Track files" ), Qgis::BabelFormatCapability::Tracks, {} );
62  mImporters[QStringLiteral( "gdb" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "gdb" ), QStringLiteral( "Garmin MapSource - gdb" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "gdb" )} );
63  mImporters[QStringLiteral( "geo" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "geo" ), QStringLiteral( "Geocaching.com .loc" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "loc" )} );
64  mImporters[QStringLiteral( "geojson" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "geojson" ), QStringLiteral( "GeoJson" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "json" )} );
65  mImporters[QStringLiteral( "geonet" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "geonet" ), QStringLiteral( "GEOnet Names Server (GNS)" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "txt" )} );
66  mImporters[QStringLiteral( "ggv_bin" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "ggv_bin" ), QStringLiteral( "Geogrid-Viewer binary overlay file (.ovl)" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "ovl" )} );
67  mImporters[QStringLiteral( "ggv_log" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "ggv_log" ), QStringLiteral( "Geogrid-Viewer tracklogs (.log)" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "log" )} );
68  mImporters[QStringLiteral( "ggv_ovl" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "ggv_ovl" ), QStringLiteral( "Geogrid-Viewer ascii overlay file (.ovl)" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "ovl" )} );
69  mImporters[QStringLiteral( "glogbook" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "glogbook" ), QStringLiteral( "Garmin Logbook XML" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "xml" )} );
70  mImporters[QStringLiteral( "gnav_trl" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "gnav_trl" ), QStringLiteral( "Google Navigator Tracklines (.trl)" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "trl" )} );
71  mImporters[QStringLiteral( "googledir" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "googledir" ), QStringLiteral( "Google Directions XML" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "xml" )} );
72  mImporters[QStringLiteral( "gopal" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "gopal" ), QStringLiteral( "GoPal GPS track log (.trk)" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "trk" )} );
73  mImporters[QStringLiteral( "gpl" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "gpl" ), QStringLiteral( "DeLorme GPL" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "gpl" )} );
74  mImporters[QStringLiteral( "gpsdrive" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "gpsdrive" ), QStringLiteral( "GpsDrive Format" ), Qgis::BabelFormatCapability::Waypoints, {} );
75  mImporters[QStringLiteral( "gpsdrivetrack" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "gpsdrivetrack" ), QStringLiteral( "GpsDrive Format for Tracks" ), Qgis::BabelFormatCapability::Waypoints, {} );
76  mImporters[QStringLiteral( "gpsman" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "gpsman" ), QStringLiteral( "GPSman" ), Qgis::BabelFormatCapability::Waypoints, {} );
77  mImporters[QStringLiteral( "gpsutil" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "gpsutil" ), QStringLiteral( "gpsutil" ), Qgis::BabelFormatCapability::Waypoints, {} );
78  mImporters[QStringLiteral( "gpx" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "gpx" ), QStringLiteral( "GPX XML" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "gpx" )} );
79  mImporters[QStringLiteral( "gtm" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "gtm" ), QStringLiteral( "GPS TrackMaker" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "gtm" )} );
80  mImporters[QStringLiteral( "gtrnctr" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "gtrnctr" ), QStringLiteral( "Garmin Training Center (.tcx/.crs/.hst/.xml)" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "tcx" ), QStringLiteral( "crs" ), QStringLiteral( "hst" ), QStringLiteral( "xml" )} );
81  mImporters[QStringLiteral( "hiketech" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "hiketech" ), QStringLiteral( "HikeTech" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "gps" )} );
82  mImporters[QStringLiteral( "holux" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "holux" ), QStringLiteral( "Holux (gm-100) .wpo Format" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "wpo" )} );
83  mImporters[QStringLiteral( "humminbird" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "humminbird" ), QStringLiteral( "Humminbird waypoints and routes (.hwr)" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "hwr" )} );
84  mImporters[QStringLiteral( "humminbird_ht" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "humminbird_ht" ), QStringLiteral( "Humminbird tracks (.ht)" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "ht" )} );
85  mImporters[QStringLiteral( "iblue747" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "iblue747" ), QStringLiteral( "Data Logger iBlue747 csv" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "csv" )} );
86  mImporters[QStringLiteral( "iblue757" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "iblue757" ), QStringLiteral( "Data Logger iBlue757 csv" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "csv" )} );
87  mImporters[QStringLiteral( "igc" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "igc" ), QStringLiteral( "FAI/IGC Flight Recorder Data Format" ), Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {} );
88  mImporters[QStringLiteral( "ignrando" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "ignrando" ), QStringLiteral( "IGN Rando track files" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "rdn" )} );
89  mImporters[QStringLiteral( "igo2008_poi" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "igo2008_poi" ), QStringLiteral( "iGO2008 points of interest (.upoi)" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "upoi" )} );
90  mImporters[QStringLiteral( "igo8" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "igo8" ), QStringLiteral( "IGO8 .trk" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "trk" )} );
91  mImporters[QStringLiteral( "igoprimo_poi" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "igoprimo_poi" ), QStringLiteral( "iGo Primo points of interest (.upoi)" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "upoi" )} );
92  mImporters[QStringLiteral( "ik3d" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "ik3d" ), QStringLiteral( "MagicMaps IK3D project file (.ikt)" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "ikt" )} );
93  mImporters[QStringLiteral( "itracku-bin" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "itracku-bin" ), QStringLiteral( "XAiOX iTrackU Logger Binary File Format" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "bin" )} );
94  mImporters[QStringLiteral( "jogmap" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "jogmap" ), QStringLiteral( "Jogmap.de XML format" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "xml" )} );
95  mImporters[QStringLiteral( "jtr" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "jtr" ), QStringLiteral( "Jelbert GeoTagger data file" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "jtr" )} );
96  mImporters[QStringLiteral( "kml" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "kml" ), QStringLiteral( "Google Earth (Keyhole) Markup Language" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "kml" )} );
97  mImporters[QStringLiteral( "kompass_tk" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "kompass_tk" ), QStringLiteral( "Kompass (DAV) Track (.tk)" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "wp" )} );
98  mImporters[QStringLiteral( "kompass_wp" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "kompass_wp" ), QStringLiteral( "Kompass (DAV) Waypoints (.wp)" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "wp" )} );
99  mImporters[QStringLiteral( "land_air_sea" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "land_air_sea" ), QStringLiteral( "GPS Tracking Key Pro text" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "txt" )} );
100  mImporters[QStringLiteral( "lmx" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "lmx" ), QStringLiteral( "Nokia Landmark Exchange" ), Qgis::BabelFormatCapability::Waypoints, {} );
101  mImporters[QStringLiteral( "lowranceusr" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "lowranceusr" ), QStringLiteral( "Lowrance USR" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "usr" )} );
102  mImporters[QStringLiteral( "m241-bin" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "m241-bin" ), QStringLiteral( "Holux M-241 (MTK based) Binary File Format" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "bin" )} );
103  mImporters[QStringLiteral( "magellan" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "magellan" ), QStringLiteral( "Magellan SD files (as for Meridian)" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {} );
104  mImporters[QStringLiteral( "magellanx" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "magellanx" ), QStringLiteral( "Magellan SD files (as for eXplorist)" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "upt" )} );
105  mImporters[QStringLiteral( "maggeo" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "maggeo" ), QStringLiteral( "Magellan Explorist Geocaching" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "gs" )} );
106  mImporters[QStringLiteral( "mainnav" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "mainnav" ), QStringLiteral( "Mainnav" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "nav" )} );
107  mImporters[QStringLiteral( "mapasia_tr7" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "mapasia_tr7" ), QStringLiteral( "MapAsia track file (.tr7)" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "tr7" )} );
108  mImporters[QStringLiteral( "mapbar" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "mapbar" ), QStringLiteral( "Mapbar (China) navigation track for Sonim Xp3300" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "trk" )} );
109  mImporters[QStringLiteral( "mapconverter" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "mapconverter" ), QStringLiteral( "Mapopolis.com Mapconverter CSV" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "txt" )} );
110  mImporters[QStringLiteral( "mapfactor" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "mapfactor" ), QStringLiteral( "Mapfactor Navigator" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "xml" )} );
111  mImporters[QStringLiteral( "mapsend" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "mapsend" ), QStringLiteral( "Magellan Mapsend" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {} );
112  mImporters[QStringLiteral( "mmo" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "mmo" ), QStringLiteral( "Memory-Map Navigator overlay files (.mmo)" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "mmo" )} );
113  mImporters[QStringLiteral( "motoactv" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "motoactv" ), QStringLiteral( "Motoactiv CSV" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "csv" )} );
114  mImporters[QStringLiteral( "mtk-bin" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "mtk-bin" ), QStringLiteral( "MTK Logger (iBlue 747,...) Binary File Format" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "bin" )} );
115  mImporters[QStringLiteral( "mtk_locus" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "mtk_locus" ), QStringLiteral( "MediaTek Locus" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, {} );
116  mImporters[QStringLiteral( "mxf" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "mxf" ), QStringLiteral( "MapTech Exchange Format" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "mxf" )} );
117  mImporters[QStringLiteral( "mynav" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "mynav" ), QStringLiteral( "MyNav TRC format" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "trc" )} );
118  mImporters[QStringLiteral( "navicache" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "navicache" ), QStringLiteral( "Navicache.com XML" ), Qgis::BabelFormatCapability::Waypoints, {} );
119  mImporters[QStringLiteral( "navigonwpt" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "navigonwpt" ), QStringLiteral( "Navigon Waypoints" ), Qgis::BabelFormatCapability::Waypoints, {} );
120  mImporters[QStringLiteral( "naviguide" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "naviguide" ), QStringLiteral( "Naviguide binary route file (.twl)" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "twl" )} );
121  mImporters[QStringLiteral( "navitel_trk" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "navitel_trk" ), QStringLiteral( "Navitel binary track (.bin)" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "bin" )} );
122  mImporters[QStringLiteral( "netstumbler" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "netstumbler" ), QStringLiteral( "NetStumbler Summary File (text)" ), Qgis::BabelFormatCapability::Waypoints, {} );
123  mImporters[QStringLiteral( "nima" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "nima" ), QStringLiteral( "NIMA/GNIS Geographic Names File" ), Qgis::BabelFormatCapability::Waypoints, {} );
124  mImporters[QStringLiteral( "nmea" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "nmea" ), QStringLiteral( "NMEA 0183 sentences" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, {} );
125  mImporters[QStringLiteral( "nmn4" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "nmn4" ), QStringLiteral( "Navigon Mobile Navigator .rte files" ), Qgis::BabelFormatCapability::Routes, {QStringLiteral( "rte" )} );
126  mImporters[QStringLiteral( "openoffice" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "openoffice" ), QStringLiteral( "Tab delimited fields useful for OpenOffice" ), Qgis::BabelFormatCapability::Waypoints, {} );
127  mImporters[QStringLiteral( "osm" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "osm" ), QStringLiteral( "OpenStreetMap data files" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes, {QStringLiteral( "osm" )} );
128  mImporters[QStringLiteral( "ozi" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "ozi" ), QStringLiteral( "OziExplorer" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {} );
129  mImporters[QStringLiteral( "pcx" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "pcx" ), QStringLiteral( "Garmin PCX5" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "pcx" )} );
130  mImporters[QStringLiteral( "pocketfms_bc" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "pocketfms_bc" ), QStringLiteral( "PocketFMS breadcrumbs" ), Qgis::BabelFormatCapability::Tracks, {} );
131  mImporters[QStringLiteral( "pocketfms_fp" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "pocketfms_fp" ), QStringLiteral( "PocketFMS flightplan (.xml)" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes, {QStringLiteral( "xml" )} );
132  mImporters[QStringLiteral( "pocketfms_wp" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "pocketfms_wp" ), QStringLiteral( "PocketFMS waypoints (.txt)" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "txt" )} );
133  mImporters[QStringLiteral( "qstarz_bl-1000" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "qstarz_bl-1000" ), QStringLiteral( "Qstarz BL-1000" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, {} );
134  mImporters[QStringLiteral( "raymarine" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "raymarine" ), QStringLiteral( "Raymarine Waypoint File (.rwf)" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes, {QStringLiteral( "rwf" )} );
135  mImporters[QStringLiteral( "ricoh" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "ricoh" ), QStringLiteral( "Ricoh GPS Log File" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "log" )} );
136  mImporters[QStringLiteral( "s_and_t" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "s_and_t" ), QStringLiteral( "Microsoft Streets and Trips 2002-2007" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "txt" )} );
137  mImporters[QStringLiteral( "saplus" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "saplus" ), QStringLiteral( "DeLorme Street Atlas Plus" ), Qgis::BabelFormatCapability::Waypoints, {} );
138  mImporters[QStringLiteral( "saroute" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "saroute" ), QStringLiteral( "DeLorme Street Atlas Route" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "anr" )} );
139  mImporters[QStringLiteral( "sbn" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "sbn" ), QStringLiteral( "NaviGPS GT-31/BGT-31 SiRF binary logfile (.sbn)" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "sbn" )} );
140  mImporters[QStringLiteral( "sbp" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "sbp" ), QStringLiteral( "NaviGPS GT-31/BGT-31 datalogger (.sbp)" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "sbp" )} );
141  mImporters[QStringLiteral( "shape" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "shape" ), QStringLiteral( "ESRI shapefile" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "shp" )} );
142  mImporters[QStringLiteral( "skyforce" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "skyforce" ), QStringLiteral( "Skymap / KMD150 ascii files" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {} );
143  mImporters[QStringLiteral( "skytraq-bin" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "skytraq-bin" ), QStringLiteral( "SkyTraq Venus based loggers Binary File Format" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "bin" )} );
144  mImporters[QStringLiteral( "stmsdf" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "stmsdf" ), QStringLiteral( "Suunto Trek Manager (STM) .sdf files" ), Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "sdf" )} );
145  mImporters[QStringLiteral( "stmwpp" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "stmwpp" ), QStringLiteral( "Suunto Trek Manager (STM) WaypointPlus files" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "txt" )} );
146  mImporters[QStringLiteral( "tef" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "tef" ), QStringLiteral( "Map&Guide 'TourExchangeFormat' XML" ), Qgis::BabelFormatCapability::Routes, {QStringLiteral( "xml" )} );
147  mImporters[QStringLiteral( "teletype" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "teletype" ), QStringLiteral( "Teletype" ), Qgis::BabelFormatCapability::Waypoints, {} );
148  mImporters[QStringLiteral( "tiger" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "tiger" ), QStringLiteral( "U.S. Census Bureau Tiger Mapping Service" ), Qgis::BabelFormatCapability::Waypoints, {} );
149  mImporters[QStringLiteral( "tmpro" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "tmpro" ), QStringLiteral( "TopoMapPro Places File" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "tmpro" )} );
150  mImporters[QStringLiteral( "tomtom" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "tomtom" ), QStringLiteral( "TomTom POI file (.ov2)" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "ov2" )} );
151  mImporters[QStringLiteral( "tomtom_asc" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "tomtom_asc" ), QStringLiteral( "TomTom POI file (.asc)" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "asc" )} );
152  mImporters[QStringLiteral( "tomtom_itn" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "tomtom_itn" ), QStringLiteral( "TomTom Itineraries (.itn)" ), Qgis::BabelFormatCapability::Routes, {QStringLiteral( "itn" )} );
153  mImporters[QStringLiteral( "tomtom_itn_places" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "tomtom_itn_places" ), QStringLiteral( "TomTom Places Itineraries (.itn)" ), Qgis::BabelFormatCapability::Routes, {QStringLiteral( "itn" )} );
154  mImporters[QStringLiteral( "tpg" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "tpg" ), QStringLiteral( "National Geographic Topo .tpg (waypoints)" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "tpg" )} );
155  mImporters[QStringLiteral( "tpo2" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "tpo2" ), QStringLiteral( "National Geographic Topo 2.x .tpo" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "tpo" )} );
156  mImporters[QStringLiteral( "tpo3" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "tpo3" ), QStringLiteral( "National Geographic Topo 3.x/4.x .tpo" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "tpo" )} );
157  mImporters[QStringLiteral( "unicsv" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "unicsv" ), QStringLiteral( "Universal csv with field structure in first line" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {} );
158  mImporters[QStringLiteral( "v900" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "v900" ), QStringLiteral( "Columbus/Visiontac V900 files (.csv)" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, {} );
159  mImporters[QStringLiteral( "vidaone" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "vidaone" ), QStringLiteral( "VidaOne GPS for Pocket PC (.gpb)" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "gpb" )} );
160  mImporters[QStringLiteral( "vitosmt" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "vitosmt" ), QStringLiteral( "Vito Navigator II tracks" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "smt" )} );
161  mImporters[QStringLiteral( "vitovtt" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "vitovtt" ), QStringLiteral( "Vito SmartMap tracks (.vtt)" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "vtt" )} );
162  mImporters[QStringLiteral( "vpl" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "vpl" ), QStringLiteral( "Honda/Acura Navigation System VP Log File Format" ), Qgis::BabelFormatCapability::Tracks, {} );
163  mImporters[QStringLiteral( "wbt-bin" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "wbt-bin" ), QStringLiteral( "Wintec WBT-100/200 Binary File Format" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "bin" )} );
164  mImporters[QStringLiteral( "wbt-tk1" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "wbt-tk1" ), QStringLiteral( "Wintec WBT-201/G-Rays 2 Binary File Format" ), Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "tk1" )} );
165  mImporters[QStringLiteral( "wfff" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "wfff" ), QStringLiteral( "WiFiFoFum 2.0 for PocketPC XML" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "xml" )} );
166  mImporters[QStringLiteral( "wintec_tes" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "wintec_tes" ), QStringLiteral( "Wintec TES file" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "tes" )} );
167  mImporters[QStringLiteral( "xmap" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "xmap" ), QStringLiteral( "DeLorme XMap HH Native .WPT" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "wpt" )} );
168  mImporters[QStringLiteral( "xmap2006" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "xmap2006" ), QStringLiteral( "DeLorme XMap/SAHH 2006 Native .TXT" ), Qgis::BabelFormatCapability::Waypoints, {QStringLiteral( "txt" )} );
169  mImporters[QStringLiteral( "xmapwpt" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "xmapwpt" ), QStringLiteral( "DeLorme XMat HH Street Atlas USA .WPT (PPC)" ), Qgis::BabelFormatCapability::Waypoints, {} );
170  mImporters[QStringLiteral( "xol" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "xol" ), QStringLiteral( "Swiss Map 25/50/100 (.xol)" ), Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, {QStringLiteral( "xol" )} );
171  mImporters[QStringLiteral( "yahoo" )] = new QgsBabelSimpleImportFormat( QStringLiteral( "yahoo" ), QStringLiteral( "Yahoo Geocode API data" ), Qgis::BabelFormatCapability::Waypoints, {} );
172 
174 }
175 
177 {
178  qDeleteAll( mImporters );
179  qDeleteAll( mDevices );
180 }
181 
183 {
184  return mImporters.keys();
185 }
186 
188 {
189  return mImporters.value( name );
190 }
191 
193 {
194  for ( auto it = mImporters.constBegin(); it != mImporters.constEnd(); ++it )
195  {
196  if ( it.value()->description().compare( description, Qt::CaseInsensitive ) == 0 )
197  return it.value();
198 
199  // also need to test square bracket variant, see logic in importFileFilter()
200  const QString descriptionSquareBrackets = it.value()->description().replace( '(', '[' ).replace( ')', ']' );
201  if ( descriptionSquareBrackets.compare( description, Qt::CaseInsensitive ) == 0 )
202  return it.value();
203  }
204  return nullptr;
205 }
206 
208 {
209  QStringList res;
210  QMap< QString, QString > descriptionToString;
211  for ( auto it = mImporters.constBegin(); it != mImporters.constEnd(); ++it )
212  {
213  const QStringList extensions = it.value()->extensions();
214  QString fileFilter;
215  if ( !extensions.empty() )
216  {
217  fileFilter = '(';
218  for ( const QString &extension : extensions )
219  fileFilter.append( QStringLiteral( "*.%1" ).arg( extension ) );
220  fileFilter.append( ')' );
221  }
222  else
223  {
224  fileFilter = QStringLiteral( "(*.*)" );
225  }
226 
227  // we have to replace round brackets from the format description, or they are treated as the filter component!
228  const QString description = it.value()->description().replace( '(', '[' ).replace( ')', ']' );
229 
230  descriptionToString.insert( description.toLower(), QStringLiteral( "%1 %2" ).arg( description, fileFilter ) );
231  }
232 
233  // build the list in a sorted order of lowercase description
234  for ( auto it = descriptionToString.constBegin(); it != descriptionToString.constEnd(); ++it )
235  res << it.value();
236 
237  return res.join( QLatin1String( ";;" ) );
238 }
239 
241 {
242  return mDevices.keys();
243 }
244 
246 {
247  return mDevices.value( name );
248 }
249 
250 QMap<QString, QgsBabelGpsDeviceFormat *> QgsBabelFormatRegistry::devices() const
251 {
252  return mDevices;
253 }
254 
256 {
257  qDeleteAll( mDevices );
258  mDevices.clear();
259 
260  mDevices[QStringLiteral( "Garmin serial" )] =
261  new QgsBabelGpsDeviceFormat( QStringLiteral( "%babel -w -i garmin -o gpx %in %out" ),
262  QStringLiteral( "%babel -w -i gpx -o garmin %in %out" ),
263  QStringLiteral( "%babel -r -i garmin -o gpx %in %out" ),
264  QStringLiteral( "%babel -r -i gpx -o garmin %in %out" ),
265  QStringLiteral( "%babel -t -i garmin -o gpx %in %out" ),
266  QStringLiteral( "%babel -t -i gpx -o garmin %in %out" ) );
267 
268  QgsSettings settings;
269 
270  bool useOldPath = false;
271  QStringList deviceNames = settings.value( QStringLiteral( "babelDeviceList" ), QVariant(), QgsSettings::Gps ).toStringList();
272  if ( deviceNames.empty() ) // migrate old settings
273  {
274  useOldPath = true;
275  deviceNames = settings.value( QStringLiteral( "Plugin-GPS/devicelist" ) ).toStringList();
276  }
277 
278  for ( const QString &device : std::as_const( deviceNames ) )
279  {
280  QString baseKey;
282  if ( !useOldPath )
283  baseKey = QStringLiteral( "babelDevices/%1" ).arg( device );
284  else
285  {
286  baseKey = QStringLiteral( "/Plugin-GPS/devices/%1" ).arg( device );
287  section = QgsSettings::NoSection;
288  }
289 
290  const QString wptDownload = settings.value( QStringLiteral( "%1/wptdownload" ).arg( baseKey ), QVariant(), section ).toString();
291  const QString wptUpload = settings.value( QStringLiteral( "%1/wptupload" ).arg( baseKey ), QVariant(), section ).toString();
292  const QString rteDownload = settings.value( QStringLiteral( "%1/rtedownload" ).arg( baseKey ), QVariant(), section ).toString();
293  const QString rteUpload = settings.value( QStringLiteral( "%1/rteupload" ).arg( baseKey ), QVariant(), section ).toString();
294  const QString trkDownload = settings.value( QStringLiteral( "%1/trkdownload" ).arg( baseKey ), QVariant(), section ).toString();
295  const QString trkUpload = settings.value( QStringLiteral( "%1/trkupload" ).arg( baseKey ), QVariant(), section ).toString();
296 
297  // don't leak memory if there's already a device with this name...
298  delete mDevices.value( device );
299 
300  mDevices[device] = new QgsBabelGpsDeviceFormat( wptDownload,
301  wptUpload,
302  rteDownload,
303  rteUpload,
304  trkDownload,
305  trkUpload );
306  }
307 }
308 
qgsbabelformat.h
QgsSettings::value
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
Definition: qgssettings.cpp:161
QgsSettings::Gps
@ Gps
GPS section, since QGIS 3.22.
Definition: qgssettings.h:79
QgsBabelGpsDeviceFormat
A babel format capable of interacting directly with a GPS device.
Definition: qgsbabelgpsdevice.h:35
Qgis::BabelFormatCapability::Tracks
@ Tracks
Format supports tracks.
QgsBabelSimpleImportFormat::description
QString description() const
Returns the friendly description for the format.
Definition: qgsbabelformat.h:132
QgsBabelSimpleImportFormat
A babel format capable of converting input files to GPX files.
Definition: qgsbabelformat.h:109
QgsSettings
This class is a composition of two QSettings instances:
Definition: qgssettings.h:61
qgsbabelgpsdevice.h
QgsBabelFormatRegistry::reloadFromSettings
void reloadFromSettings()
Reloads the registry's members from the currently stored configuration.
Definition: qgsbabelformatregistry.cpp:255
Qgis::BabelFormatCapability::Waypoints
@ Waypoints
Format supports waypoints.
QgsBabelFormatRegistry::devices
QMap< QString, QgsBabelGpsDeviceFormat * > devices() const
Returns a map of device name to device format.
Definition: qgsbabelformatregistry.cpp:250
QgsBabelFormatRegistry::importFileFilter
QString importFileFilter() const
Returns a file filter string representing all registered import formats.
Definition: qgsbabelformatregistry.cpp:207
QgsBabelFormatRegistry::deviceFormat
QgsBabelGpsDeviceFormat * deviceFormat(const QString &name)
Returns a registered device format by name.
Definition: qgsbabelformatregistry.cpp:245
QgsBabelFormatRegistry::~QgsBabelFormatRegistry
~QgsBabelFormatRegistry()
Definition: qgsbabelformatregistry.cpp:176
QgsSettings::Section
Section
Sections for namespaced settings.
Definition: qgssettings.h:67
QgsBabelFormatRegistry::importFormatByDescription
QgsBabelSimpleImportFormat * importFormatByDescription(const QString &description)
Returns a registered import format by description.
Definition: qgsbabelformatregistry.cpp:192
QgsBabelFormatRegistry::deviceNames
QStringList deviceNames() const
Returns a list of the names of all registered devices.
Definition: qgsbabelformatregistry.cpp:240
QgsBabelFormatRegistry::QgsBabelFormatRegistry
QgsBabelFormatRegistry()
Constructor for QgsBabelFormatRegistry.
Definition: qgsbabelformatregistry.cpp:25
qgssettings.h
QgsSettings::NoSection
@ NoSection
Definition: qgssettings.h:69
QgsBabelFormatRegistry::importFormatNames
QStringList importFormatNames() const
Returns a list of the names of all registered import formats.
Definition: qgsbabelformatregistry.cpp:182
qgsbabelformatregistry.h
Qgis::BabelFormatCapability::Routes
@ Routes
Format supports routes.
QgsBabelFormatRegistry::importFormat
QgsBabelSimpleImportFormat * importFormat(const QString &name)
Returns a registered import format by name.
Definition: qgsbabelformatregistry.cpp:187