From a1e10c395acee77d47040c5a990db1e0cbdc4b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Mon, 1 Jan 2024 13:02:42 +0100 Subject: [PATCH] Some more code cleanup --- src/map/ozimap.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/map/ozimap.cpp b/src/map/ozimap.cpp index 2940d55d..d4206f11 100644 --- a/src/map/ozimap.cpp +++ b/src/map/ozimap.cpp @@ -273,21 +273,21 @@ bool OziMap::setTileInfo(const QStringList &tiles, const QString &path) const QString &tile = tiles.at(i); if (tile.contains(rx)) { - _tile.path = QString(tile).replace(rx, "_%1_%2."); + QString pattern(QString(tile).replace(rx, "_%1_%2.")); if (_tar) { QByteArray ba(_tar->file(tile)); QBuffer buffer(&ba); + _tile.path = pattern; _tile.size = QImageReader(&buffer).size(); } else { - _tile.path = path + "/" + _tile.path; + _tile.path = path + "/" + pattern; _tile.size = QImageReader(path + "/" + tile).size(); } - if (_tile.size.isValid()) { - _map.path = QString(); + if (_tile.size.isValid()) return true; - } else + else qWarning("%s: error reading tile image", qPrintable(tile)); } }