diff --git a/src/GUI/gui.cpp b/src/GUI/gui.cpp index 501ddcb3..15261fd3 100644 --- a/src/GUI/gui.cpp +++ b/src/GUI/gui.cpp @@ -1325,7 +1325,10 @@ bool GUI::loadMap(const QString &fileName) if (fileName.isEmpty()) return false; - if (_ml->loadFile(fileName)) { + QFileInfo fi(fileName); + bool res = fi.isDir() ? _ml->loadDir(fileName) : _ml->loadFile(fileName); + + if (res) { QAction *a = createMapAction(_ml->maps().last()); _mapMenu->insertAction(_mapsEnd, a); _showMapAction->setEnabled(true); diff --git a/src/map/maplist.cpp b/src/map/maplist.cpp index 91f8b610..7faf88fd 100644 --- a/src/map/maplist.cpp +++ b/src/map/maplist.cpp @@ -130,8 +130,8 @@ QString MapList::formats() { return tr("Supported files") - + " (*.img *.jnx *.map *.mbtiles *.rmap *.rtmap *.tar *.tba *.tif *.tiff *.xml);;" - + tr("Garmin IMG maps") + " (*.img *.xml);;" + + " (*.gmap *.gmapi *.img *.jnx *.map *.mbtiles *.rmap *.rtmap *.tar *.tba *.tif *.tiff *.xml);;" + + tr("Garmin IMG maps") + " (*.gmap *.gmapi *.img *.xml);;" + tr("Garmin JNX maps") + " (*.jnx);;" + tr("OziExplorer maps") + " (*.map);;" + tr("MBTiles maps") + " (*.mbtiles);;" @@ -144,7 +144,7 @@ QString MapList::formats() QStringList MapList::filter() { QStringList filter; - filter << "*.img" << "*.jnx" << "*.map" << "*.tba" << "*.tar" << "*.xml" - << "*.tif" << "*.tiff" << "*.mbtiles" << "*.rmap" << "*.rtmap" << "*.img"; + filter << "*.img" << "*.jnx" << "*.map" << "*.mbtiles" << "*.rmap" + << "*.rtmap" << "*.tar" << "*.tba" << "*.tif" << "*.tiff" << "*.xml"; return filter; }