diff --git a/src/atlas.cpp b/src/atlas.cpp index 2129829f..303fb8c5 100644 --- a/src/atlas.cpp +++ b/src/atlas.cpp @@ -34,16 +34,16 @@ bool Atlas::isAtlas(Tar &tar, const QString &path) { QFileInfo fi(path); QByteArray ba; + QString suffix = fi.suffix().toLower(); - - if (fi.suffix() == "tar") { + if (suffix == "tar") { if (!tar.load(path)) { _errorString = "Error reading tar file"; return false; } QString tbaFileName = fi.completeBaseName() + ".tba"; ba = tar.file(tbaFileName); - } else if (fi.suffix() == "tba") { + } else if (suffix == "tba") { QFile tbaFile(path); if (!tbaFile.open(QIODevice::ReadOnly)) { _errorString = QString("Error opening tba file: %1") diff --git a/src/offlinemap.cpp b/src/offlinemap.cpp index 148d3382..42e7068a 100644 --- a/src/offlinemap.cpp +++ b/src/offlinemap.cpp @@ -417,6 +417,7 @@ OfflineMap::OfflineMap(const QString &fileName, QObject *parent) QString proj, datum; ProjectionSetup setup; QFileInfo fi(fileName); + QString suffix = fi.suffix().toLower(); _valid = false; @@ -424,7 +425,7 @@ OfflineMap::OfflineMap(const QString &fileName, QObject *parent) _projection = 0; _resolution = 0; - if (fi.suffix() == "tar") { + if (suffix == "tar") { if (!_tar.load(fileName)) { _errorString = "Error reading tar file"; return; @@ -439,7 +440,7 @@ OfflineMap::OfflineMap(const QString &fileName, QObject *parent) QBuffer mapFile(&ba); if (!parseMapFile(mapFile, points, proj, setup, datum)) return; - } else if (fi.suffix() =="map") { + } else if (suffix =="map") { QFile mapFile(fileName); if (!parseMapFile(mapFile, points, proj, setup, datum)) return;