1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-01-31 09:05:14 +01:00

Some more code cleanup

This commit is contained in:
Martin Tůma 2024-01-01 13:02:42 +01:00
parent c97561add4
commit a1e10c395a

View File

@ -273,21 +273,21 @@ bool OziMap::setTileInfo(const QStringList &tiles, const QString &path)
const QString &tile = tiles.at(i); const QString &tile = tiles.at(i);
if (tile.contains(rx)) { if (tile.contains(rx)) {
_tile.path = QString(tile).replace(rx, "_%1_%2."); QString pattern(QString(tile).replace(rx, "_%1_%2."));
if (_tar) { if (_tar) {
QByteArray ba(_tar->file(tile)); QByteArray ba(_tar->file(tile));
QBuffer buffer(&ba); QBuffer buffer(&ba);
_tile.path = pattern;
_tile.size = QImageReader(&buffer).size(); _tile.size = QImageReader(&buffer).size();
} else { } else {
_tile.path = path + "/" + _tile.path; _tile.path = path + "/" + pattern;
_tile.size = QImageReader(path + "/" + tile).size(); _tile.size = QImageReader(path + "/" + tile).size();
} }
if (_tile.size.isValid()) { if (_tile.size.isValid())
_map.path = QString();
return true; return true;
} else else
qWarning("%s: error reading tile image", qPrintable(tile)); qWarning("%s: error reading tile image", qPrintable(tile));
} }
} }