From 992c8aaaf91fd22935c0bfcf9b06eac988f884ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sun, 23 Apr 2017 13:37:17 +0200 Subject: [PATCH] Improved error reporting --- src/offlinemap.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/offlinemap.cpp b/src/offlinemap.cpp index ffc62e01..27c98fe3 100644 --- a/src/offlinemap.cpp +++ b/src/offlinemap.cpp @@ -370,11 +370,6 @@ bool OfflineMap::getImageInfo(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]+\\."); for (int i = 0; i < tiles.size(); i++) { 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; } @@ -533,7 +528,8 @@ void OfflineMap::load() qWarning("%s: error loading tar file", qPrintable(_tarPath)); return; } - getTileInfo(_tar.files()); + if (!getTileInfo(_tar.files())) + qWarning("%s: %s", qPrintable(_tarPath), qPrintable(_errorString)); return; }