1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-12-02 23:49:09 +01:00

Improved error reporting

This commit is contained in:
Martin Tůma 2017-04-23 13:37:17 +02:00
parent 68a72c5809
commit 992c8aaaf9

View File

@ -370,11 +370,6 @@ bool OfflineMap::getImageInfo(const QString &path)
bool OfflineMap::getTileInfo(const QStringList &tiles, const QString &path) bool OfflineMap::getTileInfo(const QStringList &tiles, const QString &path)
{ {
if (tiles.isEmpty()) {
_errorString = "Empty tile set.";
return false;
}
QRegExp rx("_[0-9]+_[0-9]+\\."); QRegExp rx("_[0-9]+_[0-9]+\\.");
for (int i = 0; i < tiles.size(); i++) { for (int i = 0; i < tiles.size(); i++) {
if (tiles.at(i).contains(rx)) { if (tiles.at(i).contains(rx)) {
@ -398,7 +393,7 @@ bool OfflineMap::getTileInfo(const QStringList &tiles, const QString &path)
} }
} }
_errorString = "Invalid tile names"; _errorString = "Invalid/missing tile set";
return false; return false;
} }
@ -533,7 +528,8 @@ void OfflineMap::load()
qWarning("%s: error loading tar file", qPrintable(_tarPath)); qWarning("%s: error loading tar file", qPrintable(_tarPath));
return; return;
} }
getTileInfo(_tar.files()); if (!getTileInfo(_tar.files()))
qWarning("%s: %s", qPrintable(_tarPath), qPrintable(_errorString));
return; return;
} }