mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
Properly open all selected files (tar content/atlas structure is however still case sensitive)
This commit is contained in:
parent
e4e3f7d143
commit
eace308774
@ -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")
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user