1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-01-18 11:52:08 +01:00

qPrintable() -> qUtf8Printable()

This commit is contained in:
Martin Tůma 2025-01-04 00:18:27 +01:00
parent 2b967ce05e
commit ad13a5b0cf
40 changed files with 148 additions and 140 deletions

View File

@ -164,7 +164,8 @@ void GUI::mapInitialized()
_showMapAction->setEnabled(true); _showMapAction->setEnabled(true);
_clearMapCacheAction->setEnabled(true); _clearMapCacheAction->setEnabled(true);
} else { } else {
qWarning("%s: %s", qPrintable(map->path()), qPrintable(map->errorString())); qWarning("%s: %s", qUtf8Printable(map->path()),
qUtf8Printable(map->errorString()));
action->deleteLater(); action->deleteLater();
} }
} }

View File

@ -127,11 +127,11 @@ Data::Data(const QString &fileName, bool tryUnknown)
++it; ++it;
} }
qWarning("%s:", qPrintable(fileName)); qWarning("%s:", qUtf8Printable(fileName));
for (it = _parsers.find(suffix); it != _parsers.end() for (it = _parsers.find(suffix); it != _parsers.end()
&& it.key() == suffix; it++) && it.key() == suffix; it++)
qWarning(" %s: line %d: %s", qPrintable(it.key()), qWarning(" %s: line %d: %s", qUtf8Printable(it.key()),
it.value()->errorLine(), qPrintable(it.value()->errorString())); it.value()->errorLine(), qUtf8Printable(it.value()->errorString()));
} else if (tryUnknown) { } else if (tryUnknown) {
for (it = _parsers.begin(); it != _parsers.end(); it++) { for (it = _parsers.begin(); it != _parsers.end(); it++) {
@ -144,10 +144,10 @@ Data::Data(const QString &fileName, bool tryUnknown)
file.reset(); file.reset();
} }
qWarning("%s:", qPrintable(fileName)); qWarning("%s:", qUtf8Printable(fileName));
for (it = _parsers.begin(); it != _parsers.end(); it++) for (it = _parsers.begin(); it != _parsers.end(); it++)
qWarning(" %s: line %d: %s", qPrintable(it.key()), qWarning(" %s: line %d: %s", qUtf8Printable(it.key()),
it.value()->errorLine(), qPrintable(it.value()->errorString())); it.value()->errorLine(), qUtf8Printable(it.value()->errorString()));
_errorLine = 0; _errorLine = 0;
_errorString = "Unknown format"; _errorString = "Unknown format";

View File

@ -245,7 +245,7 @@ bool IGCParser::parse(QFile *file, QList<TrackData> &tracks,
/* The date H header is mandatory, but XCSOAR generates /* The date H header is mandatory, but XCSOAR generates
files without it, so add a dummy date in such case */ files without it, so add a dummy date in such case */
qWarning("%s: Missing date header", qWarning("%s: Missing date header",
qPrintable(file->fileName())); qUtf8Printable(file->fileName()));
ctx.date = QDate(1970, 1, 1); ctx.date = QDate(1970, 1, 1);
} }
if (!track) { if (!track) {

View File

@ -28,11 +28,12 @@ bool OMDParser::readHeaderFile(const QString &omdPath, Header &hdr)
char buffer[60]; char buffer[60];
if (!file.open(QIODevice::ReadOnly)) { if (!file.open(QIODevice::ReadOnly)) {
qWarning("%s: %s", qPrintable(path), qPrintable(file.errorString())); qWarning("%s: %s", qUtf8Printable(path),
qUtf8Printable(file.errorString()));
return false; return false;
} }
if (file.read(buffer, sizeof(buffer)) != sizeof(buffer)) { if (file.read(buffer, sizeof(buffer)) != sizeof(buffer)) {
qWarning("%s: invalid OMH file", qPrintable(path)); qWarning("%s: invalid OMH file", qUtf8Printable(path));
return false; return false;
} }
@ -48,7 +49,7 @@ bool OMDParser::readHeaderFile(const QString &omdPath, Header &hdr)
QDateTime date(QDate(Y + 2000, M, D), QTime(h, m), QTimeZone::utc()); QDateTime date(QDate(Y + 2000, M, D), QTime(h, m), QTimeZone::utc());
if (!date.isValid()) { if (!date.isValid()) {
qWarning("%s: invalid date", qPrintable(path)); qWarning("%s: invalid date", qUtf8Printable(path));
return false; return false;
} }
@ -183,11 +184,12 @@ bool GHPParser::readHeaderFile(const QString &ghpPath, Header &hdr)
char buffer[96]; char buffer[96];
if (!file.open(QIODevice::ReadOnly)) { if (!file.open(QIODevice::ReadOnly)) {
qWarning("%s: %s", qPrintable(path), qPrintable(file.errorString())); qWarning("%s: %s", qUtf8Printable(path),
qUtf8Printable(file.errorString()));
return false; return false;
} }
if (file.read(buffer, sizeof(buffer)) != sizeof(buffer)) { if (file.read(buffer, sizeof(buffer)) != sizeof(buffer)) {
qWarning("%s: invalid GHT file", qPrintable(path)); qWarning("%s: invalid GHT file", qUtf8Printable(path));
return false; return false;
} }
@ -202,7 +204,7 @@ bool GHPParser::readHeaderFile(const QString &ghpPath, Header &hdr)
QDateTime date(QDate(Y + 2000, M, D), QTime(h, m, s), QTimeZone::utc()); QDateTime date(QDate(Y + 2000, M, D), QTime(h, m, s), QTimeZone::utc());
if (!date.isValid()) { if (!date.isValid()) {
qWarning("%s: invalid date", qPrintable(path)); qWarning("%s: invalid date", qUtf8Printable(path));
return false; return false;
} }

View File

@ -108,8 +108,8 @@ TreeNode<QString> POI::loadDir(const QString &path)
if (loadFile(fi.absoluteFilePath())) if (loadFile(fi.absoluteFilePath()))
tree.addItem(fi.absoluteFilePath()); tree.addItem(fi.absoluteFilePath());
else else
qWarning("%s: %s", qPrintable(fi.absoluteFilePath()), qWarning("%s: %s", qUtf8Printable(fi.absoluteFilePath()),
qPrintable(_errorString)); qUtf8Printable(_errorString));
} }
} }

View File

@ -3,7 +3,7 @@
void SLFParser::warning(const char *text) const void SLFParser::warning(const char *text) const
{ {
const QFile *file = static_cast<QFile *>(_reader.device()); const QFile *file = static_cast<QFile *>(_reader.device());
qWarning("%s:%lld: %s", qPrintable(file->fileName()), qWarning("%s:%lld: %s", qUtf8Printable(file->fileName()),
_reader.lineNumber(), text); _reader.lineNumber(), text);
} }

View File

@ -4,7 +4,7 @@
void TCXParser::warning(const char *text) const void TCXParser::warning(const char *text) const
{ {
const QFile *file = static_cast<QFile *>(_reader.device()); const QFile *file = static_cast<QFile *>(_reader.device());
qWarning("%s:%lld: %s", qPrintable(file->fileName()), qWarning("%s:%lld: %s", qUtf8Printable(file->fileName()),
_reader.lineNumber(), text); _reader.lineNumber(), text);
} }

View File

@ -140,8 +140,7 @@ Track::Track(const TrackData &data) : _pause(0)
bool hasTime = !std::isnan(seg.time.first()); bool hasTime = !std::isnan(seg.time.first());
for (int j = 1; j < sd.size(); j++) { for (int j = 1; j < sd.size(); j++) {
ds = sd.at(j).coordinates().distanceTo( ds = sd.at(j).coordinates().distanceTo(sd.at(j-1).coordinates());
sd.at(j-1).coordinates());
seg.distance.append(seg.distance.last() + ds); seg.distance.append(seg.distance.last() + ds);
if (hasTime && sd.at(j).timestamp().isValid()) { if (hasTime && sd.at(j).timestamp().isValid()) {
@ -149,16 +148,16 @@ Track::Track(const TrackData &data) : _pause(0)
dt = sd.at(j-1).timestamp().msecsTo( dt = sd.at(j-1).timestamp().msecsTo(
sd.at(j).timestamp()) / 1000.0; sd.at(j).timestamp()) / 1000.0;
else { else {
qWarning("%s: %s: time skew detected", qPrintable( qWarning("%s: %s: time skew detected",
_data.name()), qPrintable(sd.at(j).timestamp().toString( qUtf8Printable(_data.name()),
Qt::ISODate))); qUtf8Printable(sd.at(j).timestamp().toString(Qt::ISODate)));
dt = 0; dt = 0;
} }
} else { } else {
dt = NAN; dt = NAN;
if (hasTime) { if (hasTime) {
qWarning("%s: missing timestamp(s), time graphs disabled", qWarning("%s: missing timestamp(s), time graphs disabled",
qPrintable(_data.name())); qUtf8Printable(_data.name()));
hasTime = false; hasTime = false;
for (int i = 0; i < seg.time.size(); i++) for (int i = 0; i < seg.time.size(); i++)
seg.time[i] = NAN; seg.time[i] = NAN;

View File

@ -37,7 +37,7 @@ void Waypoint::loadSymbolIcons(const QString &dir)
QPixmap pm(files.at(i).absoluteFilePath()); QPixmap pm(files.at(i).absoluteFilePath());
if (pm.isNull()) if (pm.isNull())
qWarning("%s: error loading image", qWarning("%s: error loading image",
qPrintable(files.at(i).absoluteFilePath())); qUtf8Printable(files.at(i).absoluteFilePath()));
else else
_symbolIcons.insert(files.at(i).baseName(), pm); _symbolIcons.insert(files.at(i).baseName(), pm);
} }

View File

@ -89,7 +89,7 @@ bool GMAPData::loadTile(const QDir &dir)
if (VectorTile::isTileFile(tt)) { if (VectorTile::isTileFile(tt)) {
if (!tile->addFile(fi.absoluteFilePath(), tt)) { if (!tile->addFile(fi.absoluteFilePath(), tt)) {
qWarning("%s: Invalid map tile structure", qWarning("%s: Invalid map tile structure",
qPrintable(dir.path())); qUtf8Printable(dir.path()));
delete tile; delete tile;
return false; return false;
} }
@ -97,7 +97,7 @@ bool GMAPData::loadTile(const QDir &dir)
} }
if (!tile->init()) { if (!tile->init()) {
qWarning("%s: Invalid map tile", qPrintable(dir.path())); qWarning("%s: Invalid map tile", qUtf8Printable(dir.path()));
delete tile; delete tile;
return false; return false;
} }

View File

@ -146,8 +146,8 @@ bool IMGData::createTileTree(QFile *file, const TileMap &tileMap)
VectorTile *tile = it.value(); VectorTile *tile = it.value();
if (!tile->init(file)) { if (!tile->init(file)) {
qWarning("%s: %s: Invalid map tile", qPrintable(_fileName), qWarning("%s: %s: Invalid map tile", qUtf8Printable(_fileName),
qPrintable(it.key())); qUtf8Printable(it.key()));
delete tile; delete tile;
continue; continue;
} }

View File

@ -446,8 +446,8 @@ void RasterTile::fetchData(QList<MapData::Poly> &polygons,
if (dynamic_cast<IMGData*>(_data)) { if (dynamic_cast<IMGData*>(_data)) {
_file = new QFile(_data->fileName()); _file = new QFile(_data->fileName());
if (!_file->open(QIODevice::ReadOnly | QIODevice::Unbuffered)) { if (!_file->open(QIODevice::ReadOnly | QIODevice::Unbuffered)) {
qWarning("%s: %s", qPrintable(_file->fileName()), qWarning("%s: %s", qUtf8Printable(_file->fileName()),
qPrintable(_file->errorString())); qUtf8Printable(_file->errorString()));
return; return;
} }
} }

View File

@ -1177,7 +1177,7 @@ bool Style::parsePolygons(SubFile *file, SubFile::Handle &hdl,
if (!parsePolygon(file, hdl, section, info, type)) if (!parsePolygon(file, hdl, section, info, type))
qWarning("%s: %x: broken polygon style", qWarning("%s: %x: broken polygon style",
qPrintable(file->fileName()), type); qUtf8Printable(file->fileName()), type);
} }
return true; return true;
@ -1201,8 +1201,8 @@ bool Style::parseLines(SubFile *file, SubFile::Handle &hdl,
? 0x10000 | (info.type << 8) | info.subtype : (info.type << 8); ? 0x10000 | (info.type << 8) | info.subtype : (info.type << 8);
if (!parseLine(file, hdl, section, info, type)) if (!parseLine(file, hdl, section, info, type))
qWarning("%s: %x: broken line style", qPrintable(file->fileName()), qWarning("%s: %x: broken line style",
type); qUtf8Printable(file->fileName()), type);
} }
return true; return true;
@ -1227,8 +1227,8 @@ bool Style::parsePoints(SubFile *file, SubFile::Handle &hdl,
: (info.type << 8) | info.subtype; : (info.type << 8) | info.subtype;
if (!parsePoint(file, hdl, section, info, type)) if (!parsePoint(file, hdl, section, info, type))
qWarning("%s: %x: broken point style", qPrintable(file->fileName()), qWarning("%s: %x: broken point style",
type); qUtf8Printable(file->fileName()), type);
} }
return true; return true;
@ -1304,7 +1304,7 @@ bool Style::parseTYPFile(SubFile *typ)
&& parsePolygons(typ, hdl, polygons) && parsePolygons(typ, hdl, polygons)
&& parseDrawOrder(typ, hdl, order))) { && parseDrawOrder(typ, hdl, order))) {
qWarning("%s: Invalid TYP file, using default style", qWarning("%s: Invalid TYP file, using default style",
qPrintable(typ->fileName())); qUtf8Printable(typ->fileName()));
return false; return false;
} }

View File

@ -27,8 +27,8 @@ public:
if (!_file) { if (!_file) {
_file = new QFile(subFile->fileName()); _file = new QFile(subFile->fileName());
if (!_file->open(QIODevice::ReadOnly | QIODevice::Unbuffered)) if (!_file->open(QIODevice::ReadOnly | QIODevice::Unbuffered))
qWarning("%s: %s", qPrintable(_file->fileName()), qWarning("%s: %s", qUtf8Printable(_file->fileName()),
qPrintable(_file->errorString())); qUtf8Printable(_file->errorString()));
_delete = true; _delete = true;
} }
_data.resize(subFile->blockSize()); _data.resize(subFile->blockSize());

View File

@ -259,8 +259,8 @@ void AQMMap::load(const Projection &in, const Projection &out,
_mapRatio = hidpi ? deviceRatio : 1.0; _mapRatio = hidpi ? deviceRatio : 1.0;
if (!_file.open(QIODevice::ReadOnly)) if (!_file.open(QIODevice::ReadOnly))
qWarning("%s: %s", qPrintable(_file.fileName()), qWarning("%s: %s", qUtf8Printable(_file.fileName()),
qPrintable(_file.errorString())); qUtf8Printable(_file.errorString()));
} }
void AQMMap::unload() void AQMMap::unload()

View File

@ -156,7 +156,8 @@ Atlas::Atlas(const QString &fileName, bool TAR, const Projection &proj,
OziMap::CalibrationType type; OziMap::CalibrationType type;
QString cf(calibrationFile(path, type)); QString cf(calibrationFile(path, type));
if (cf.isNull()) { if (cf.isNull()) {
qWarning("%s: no calibration file found", qPrintable(path)); qWarning("%s: no calibration file found",
qUtf8Printable(path));
continue; continue;
} }
map = new OziMap(cf, type, proj, this); map = new OziMap(cf, type, proj, this);
@ -165,8 +166,8 @@ Atlas::Atlas(const QString &fileName, bool TAR, const Projection &proj,
if (map->isValid()) if (map->isValid())
_maps.append(map); _maps.append(map);
else { else {
qWarning("%s: %s", qPrintable(map->path()), qWarning("%s: %s", qUtf8Printable(map->path()),
qPrintable(map->errorString())); qUtf8Printable(map->errorString()));
delete map; delete map;
} }
} }

View File

@ -141,17 +141,18 @@ bool Conversion::loadList(const QString &path)
bool res; bool res;
if (!file.open(QFile::ReadOnly)) { if (!file.open(QFile::ReadOnly)) {
qWarning("%s: %s", qPrintable(path), qPrintable(file.errorString())); qWarning("%s: %s", qUtf8Printable(path),
qUtf8Printable(file.errorString()));
return false; return false;
} }
while (!csv.atEnd()) { while (!csv.atEnd()) {
if (!csv.readEntry(entry)) { if (!csv.readEntry(entry)) {
qWarning("%s:%d: Parse error", qPrintable(path), csv.line()); qWarning("%s:%d: Parse error", qUtf8Printable(path), csv.line());
return false; return false;
} }
if (entry.size() < 26) { if (entry.size() < 26) {
qWarning("%s:%d: Invalid column count", qPrintable(path), qWarning("%s:%d: Invalid column count", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
return false; return false;
} }
@ -159,42 +160,42 @@ bool Conversion::loadList(const QString &path)
QString name(entry.at(0)); QString name(entry.at(0));
int proj = entry.at(1).toInt(&res); int proj = entry.at(1).toInt(&res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid projection code", qPrintable(path), qWarning("%s:%d: Invalid projection code", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
continue; continue;
} }
int units = entry.at(2).toInt(&res); int units = entry.at(2).toInt(&res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid linear units code", qPrintable(path), qWarning("%s:%d: Invalid linear units code", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
continue; continue;
} }
int transform = entry.at(3).toInt(&res); int transform = entry.at(3).toInt(&res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid coordinate transformation code", qWarning("%s:%d: Invalid coordinate transformation code",
qPrintable(path), csv.line() - 1); qUtf8Printable(path), csv.line() - 1);
continue; continue;
} }
int cs = entry.at(4).toInt(&res); int cs = entry.at(4).toInt(&res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid coordinate system code", qWarning("%s:%d: Invalid coordinate system code",
qPrintable(path), csv.line() - 1); qUtf8Printable(path), csv.line() - 1);
continue; continue;
} }
if (!LinearUnits(units).isValid()) { if (!LinearUnits(units).isValid()) {
qWarning("%s:%d: Unknown linear units code", qPrintable(path), qWarning("%s:%d: Unknown linear units code", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
continue; continue;
} }
if (!Method(transform).isValid()) { if (!Method(transform).isValid()) {
qWarning("%s:%d: Unknown coordinate transformation code", qWarning("%s:%d: Unknown coordinate transformation code",
qPrintable(path), csv.line() - 1); qUtf8Printable(path), csv.line() - 1);
continue; continue;
} }
if (!CoordinateSystem(cs).isValid()) { if (!CoordinateSystem(cs).isValid()) {
qWarning("%s:%d: Unknown coordinate system code", qPrintable(path), qWarning("%s:%d: Unknown coordinate system code",
csv.line() - 1); qUtf8Printable(path), csv.line() - 1);
continue; continue;
} }
@ -202,7 +203,7 @@ bool Conversion::loadList(const QString &path)
int pn = projectionSetup(entry, setup); int pn = projectionSetup(entry, setup);
if (pn) { if (pn) {
qWarning("%s: %d: Invalid projection parameter #%d", qWarning("%s: %d: Invalid projection parameter #%d",
qPrintable(path), csv.line(), pn); qUtf8Printable(path), csv.line(), pn);
continue; continue;
} }

View File

@ -131,8 +131,8 @@ DEM::Entry *DEM::loadTile(const Tile &tile)
} else { } else {
QFile file(path); QFile file(path);
if (!file.open(QIODevice::ReadOnly)) { if (!file.open(QIODevice::ReadOnly)) {
qWarning("%s: %s", qPrintable(file.fileName()), qWarning("%s: %s", qUtf8Printable(file.fileName()),
qPrintable(file.errorString())); qUtf8Printable(file.errorString()));
return new Entry(); return new Entry();
} else } else
return new Entry(file.readAll()); return new Entry(file.readAll());

View File

@ -57,7 +57,7 @@ bool DEMLoader::loadTiles(const RectC &rect)
/* Create the user DEM dir only when a download is requested as it will /* Create the user DEM dir only when a download is requested as it will
override the global DEM dir. */ override the global DEM dir. */
if (!_dir.mkpath(_dir.absolutePath())) { if (!_dir.mkpath(_dir.absolutePath())) {
qWarning("%s: %s", qPrintable(_dir.canonicalPath()), qWarning("%s: %s", qUtf8Printable(_dir.canonicalPath()),
"Error creating DEM directory"); "Error creating DEM directory");
return false; return false;
} }

View File

@ -165,7 +165,7 @@ bool Downloader::doDownload(const Download &dl, const QList<HTTPHeader> &headers
if (!url.isValid() || !(url.scheme() == QLatin1String("http") if (!url.isValid() || !(url.scheme() == QLatin1String("http")
|| url.scheme() == QLatin1String("https"))) { || url.scheme() == QLatin1String("https"))) {
qWarning("%s: Invalid URL", qPrintable(url.toString())); qWarning("%s: Invalid URL", qUtf8Printable(url.toString()));
return false; return false;
} }
@ -195,8 +195,8 @@ bool Downloader::doDownload(const Download &dl, const QList<HTTPHeader> &headers
QFile *file = new QFile(tmpName(dl.file())); QFile *file = new QFile(tmpName(dl.file()));
if (!file->open(QIODevice::WriteOnly)) { if (!file->open(QIODevice::WriteOnly)) {
qWarning("%s: %s", qPrintable(file->fileName()), qWarning("%s: %s", qUtf8Printable(file->fileName()),
qPrintable(file->errorString())); qUtf8Printable(file->errorString()));
delete file; delete file;
_errorDownloads.insert(url, RETRIES); _errorDownloads.insert(url, RETRIES);
return false; return false;

View File

@ -38,36 +38,37 @@ bool Ellipsoid::loadList(const QString &path)
bool res; bool res;
if (!file.open(QFile::ReadOnly)) { if (!file.open(QFile::ReadOnly)) {
qWarning("%s: %s", qPrintable(path), qPrintable(file.errorString())); qWarning("%s: %s", qUtf8Printable(path),
qUtf8Printable(file.errorString()));
return false; return false;
} }
while (!csv.atEnd()) { while (!csv.atEnd()) {
if (!csv.readEntry(entry)) { if (!csv.readEntry(entry)) {
qWarning("%s:%d: Parse error", qPrintable(path), csv.line()); qWarning("%s:%d: Parse error", qUtf8Printable(path), csv.line());
return false; return false;
} }
if (entry.size() < 4) { if (entry.size() < 4) {
qWarning("%s:%d: Invalid column count", qPrintable(path), qWarning("%s:%d: Invalid column count", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
return false; return false;
} }
int id = entry.at(1).toInt(&res); int id = entry.at(1).toInt(&res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid ellipsoid code", qPrintable(path), qWarning("%s:%d: Invalid ellipsoid code", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
continue; continue;
} }
double radius = entry.at(2).toDouble(&res); double radius = entry.at(2).toDouble(&res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid radius", qPrintable(path), qWarning("%s:%d: Invalid radius", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
continue; continue;
} }
double flattening = entry.at(3).toDouble(&res); double flattening = entry.at(3).toDouble(&res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid flattening", qPrintable(path), qWarning("%s:%d: Invalid flattening", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
continue; continue;
} }

View File

@ -102,11 +102,11 @@ void ENCAtlas::addMap(const QDir &dir, const QByteArray &file,
{ {
QString path(dir.absoluteFilePath(file)); QString path(dir.absoluteFilePath(file));
if (!QFileInfo::exists(path)) { if (!QFileInfo::exists(path)) {
qWarning("%s: No such map file", qPrintable(path)); qWarning("%s: No such map file", qUtf8Printable(path));
return; return;
} }
if (!bounds.isValid()) { if (!bounds.isValid()) {
qWarning("%s: Invalid map bounds", qPrintable(path)); qWarning("%s: Invalid map bounds", qUtf8Printable(path));
return; return;
} }

View File

@ -102,96 +102,97 @@ bool GCS::loadList(const QString &path)
bool res; bool res;
if (!file.open(QFile::ReadOnly)) { if (!file.open(QFile::ReadOnly)) {
qWarning("%s: %s", qPrintable(path), qPrintable(file.errorString())); qWarning("%s: %s", qUtf8Printable(path),
qUtf8Printable(file.errorString()));
return false; return false;
} }
while (!csv.atEnd()) { while (!csv.atEnd()) {
if (!csv.readEntry(entry)) { if (!csv.readEntry(entry)) {
qWarning("%s:%d: Parse error", qPrintable(path), csv.line()); qWarning("%s:%d: Parse error", qUtf8Printable(path), csv.line());
return false; return false;
} }
if (entry.size() < 14) { if (entry.size() < 14) {
qWarning("%s:%d: Invalid column count", qPrintable(path), qWarning("%s:%d: Invalid column count", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
return false; return false;
} }
int id = parameter(entry.at(1), &res); int id = parameter(entry.at(1), &res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid GCS code", qPrintable(path), qWarning("%s:%d: Invalid GCS code", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
continue; continue;
} }
int gd = parameter(entry.at(2), &res); int gd = parameter(entry.at(2), &res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid geodetic datum code", qPrintable(path), qWarning("%s:%d: Invalid geodetic datum code", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
continue; continue;
} }
int au = entry.at(3).toInt(&res); int au = entry.at(3).toInt(&res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid angular units code", qPrintable(path), qWarning("%s:%d: Invalid angular units code", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
continue; continue;
} }
int el = entry.at(4).toInt(&res); int el = entry.at(4).toInt(&res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid ellipsoid code", qPrintable(path), qWarning("%s:%d: Invalid ellipsoid code", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
continue; continue;
} }
int pm = entry.at(5).toInt(&res); int pm = entry.at(5).toInt(&res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid prime meridian code", qPrintable(path), qWarning("%s:%d: Invalid prime meridian code", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
continue; continue;
} }
int ct = entry.at(6).toInt(&res); int ct = entry.at(6).toInt(&res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid coordinates transformation code", qWarning("%s:%d: Invalid coordinates transformation code",
qPrintable(path), csv.line() - 1); qUtf8Printable(path), csv.line() - 1);
continue; continue;
} }
double dx = entry.at(7).toDouble(&res); double dx = entry.at(7).toDouble(&res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid dx", qPrintable(path), csv.line() - 1); qWarning("%s:%d: Invalid dx", qUtf8Printable(path), csv.line() - 1);
continue; continue;
} }
double dy = entry.at(8).toDouble(&res); double dy = entry.at(8).toDouble(&res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid dy", qPrintable(path), csv.line() - 1); qWarning("%s:%d: Invalid dy", qUtf8Printable(path), csv.line() - 1);
continue; continue;
} }
double dz = entry.at(9).toDouble(&res); double dz = entry.at(9).toDouble(&res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid dz", qPrintable(path), csv.line() - 1); qWarning("%s:%d: Invalid dz", qUtf8Printable(path), csv.line() - 1);
continue; continue;
} }
double rx = parameterd(entry.at(10), &res); double rx = parameterd(entry.at(10), &res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid rx", qPrintable(path), csv.line() - 1); qWarning("%s:%d: Invalid rx", qUtf8Printable(path), csv.line() - 1);
continue; continue;
} }
double ry = parameterd(entry.at(11), &res); double ry = parameterd(entry.at(11), &res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid ry", qPrintable(path), csv.line() - 1); qWarning("%s:%d: Invalid ry", qUtf8Printable(path), csv.line() - 1);
continue; continue;
} }
double rz = parameterd(entry.at(12), &res); double rz = parameterd(entry.at(12), &res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid rz", qPrintable(path), csv.line() - 1); qWarning("%s:%d: Invalid rz", qUtf8Printable(path), csv.line() - 1);
continue; continue;
} }
double ds = parameterd(entry.at(13), &res); double ds = parameterd(entry.at(13), &res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid ds", qPrintable(path), csv.line() - 1); qWarning("%s:%d: Invalid ds", qUtf8Printable(path), csv.line() - 1);
continue; continue;
} }
const Ellipsoid &e = Ellipsoid::ellipsoid(el); const Ellipsoid &e = Ellipsoid::ellipsoid(el);
if (e.isNull()) { if (e.isNull()) {
qWarning("%s:%d: Unknown ellipsoid code", qPrintable(path), qWarning("%s:%d: Unknown ellipsoid code", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
continue; continue;
} }
@ -209,12 +210,12 @@ bool GCS::loadList(const QString &path)
break; break;
default: default:
qWarning("%s:%d: Unknown coordinates transformation method", qWarning("%s:%d: Unknown coordinates transformation method",
qPrintable(path), csv.line() - 1); qUtf8Printable(path), csv.line() - 1);
continue; continue;
} }
if (!datum.isValid()) { if (!datum.isValid()) {
qWarning("%s:%d: Invalid coordinates transformation parameters", qWarning("%s:%d: Invalid coordinates transformation parameters",
qPrintable(path), csv.line() - 1); qUtf8Printable(path), csv.line() - 1);
continue; continue;
} }
@ -223,7 +224,7 @@ bool GCS::loadList(const QString &path)
_gcss.append(Entry(id, gd, entry.at(0), gcs)); _gcss.append(Entry(id, gd, entry.at(0), gcs));
else else
qWarning("%s:%d: Unknown prime meridian/angular units code", qWarning("%s:%d: Unknown prime meridian/angular units code",
qPrintable(path), csv.line() - 1); qUtf8Printable(path), csv.line() - 1);
} }
std::sort(_gcss.begin(), _gcss.end()); std::sort(_gcss.begin(), _gcss.end());

View File

@ -190,8 +190,8 @@ void GEMFMap::load(const Projection &in, const Projection &out,
_mapRatio = hidpi ? deviceRatio : 1.0; _mapRatio = hidpi ? deviceRatio : 1.0;
if (!_file.open(QIODevice::ReadOnly)) if (!_file.open(QIODevice::ReadOnly))
qWarning("%s: %s", qPrintable(_file.fileName()), qWarning("%s: %s", qUtf8Printable(_file.fileName()),
qPrintable(_file.errorString())); qUtf8Printable(_file.errorString()));
} }
void GEMFMap::unload() void GEMFMap::unload()

View File

@ -46,8 +46,8 @@ static QList<MapData*> overlays(const QString &fileName)
if (data->isValid()) if (data->isValid())
list.append(data); list.append(data);
else { else {
qWarning("%s: %s", qPrintable(data->fileName()), qWarning("%s: %s", qUtf8Printable(data->fileName()),
qPrintable(data->errorString())); qUtf8Printable(data->errorString()));
delete data; delete data;
} }
} else } else

View File

@ -163,8 +163,8 @@ void JNXMap::load(const Projection &in, const Projection &out,
_mapRatio = hidpi ? deviceRatio : 1.0; _mapRatio = hidpi ? deviceRatio : 1.0;
if (!_file.open(QIODevice::ReadOnly)) if (!_file.open(QIODevice::ReadOnly))
qWarning("%s: %s", qPrintable(_file.fileName()), qWarning("%s: %s", qUtf8Printable(_file.fileName()),
qPrintable(_file.errorString())); qUtf8Printable(_file.errorString()));
else else
readTiles(); readTiles();
} }

View File

@ -96,9 +96,9 @@ Map *MapList::loadFile(const QString &path, const Projection &proj, bool *isDir)
} }
} }
qWarning("%s:", qPrintable(path)); qWarning("%s:", qUtf8Printable(path));
for (int i = 0; i < errors.size(); i++) for (int i = 0; i < errors.size(); i++)
qWarning(" %s", qPrintable(errors.at(i))); qWarning(" %s", qUtf8Printable(errors.at(i)));
return map ? map : new InvalidMap(path, "Unknown file format"); return map ? map : new InvalidMap(path, "Unknown file format");
} }

View File

@ -461,8 +461,8 @@ void MapData::load()
QFile file(_fileName); QFile file(_fileName);
if (!file.open(QIODevice::ReadOnly | QIODevice::Unbuffered)) if (!file.open(QIODevice::ReadOnly | QIODevice::Unbuffered))
qWarning("%s: %s", qPrintable(file.fileName()), qWarning("%s: %s", qUtf8Printable(file.fileName()),
qPrintable(file.errorString())); qUtf8Printable(file.errorString()));
else else
readSubFiles(file); readSubFiles(file);
} }

View File

@ -411,8 +411,8 @@ void RasterTile::fetchData(QList<MapData::Path> &paths,
QFile file(_data->fileName()); QFile file(_data->fileName());
if (!file.open(QIODevice::ReadOnly | QIODevice::Unbuffered)) { if (!file.open(QIODevice::ReadOnly | QIODevice::Unbuffered)) {
qWarning("%s: %s", qPrintable(file.fileName()), qWarning("%s: %s", qUtf8Printable(file.fileName()),
qPrintable(file.errorString())); qUtf8Printable(file.errorString()));
return; return;
} }

View File

@ -85,7 +85,7 @@ const Style::Menu::Layer *Style::Menu::findLayer(const QString &id) const
if (_layers.at(i).id() == id) if (_layers.at(i).id() == id)
return &_layers.at(i); return &_layers.at(i);
qWarning("%s: layer not found", qPrintable(id)); qWarning("%s: layer not found", qUtf8Printable(id));
return 0; return 0;
} }
@ -792,8 +792,8 @@ bool Style::loadXml(const QString &path, const MapData &data, qreal ratio)
} }
if (reader.error()) if (reader.error())
qWarning("%s:%lld %s", qPrintable(path), reader.lineNumber(), qWarning("%s:%lld %s", qUtf8Printable(path), reader.lineNumber(),
qPrintable(reader.errorString())); qUtf8Printable(reader.errorString()));
return !reader.error(); return !reader.error();
} }

View File

@ -41,7 +41,7 @@ bool MBTilesMap::getMinZoom(int &zoom)
return false; return false;
} }
} else { } else {
qWarning("%s: missing minzoom metadata", qPrintable(path())); qWarning("%s: missing minzoom metadata", qUtf8Printable(path()));
zoom = OSM::ZOOMS.min(); zoom = OSM::ZOOMS.min();
} }
@ -60,7 +60,7 @@ bool MBTilesMap::getMaxZoom(int &zoom)
return false; return false;
} }
} else { } else {
qWarning("%s: missing maxzoom metadata", qPrintable(path())); qWarning("%s: missing maxzoom metadata", qUtf8Printable(path()));
zoom = OSM::ZOOMS.max(); zoom = OSM::ZOOMS.max();
} }
@ -103,7 +103,7 @@ bool MBTilesMap::getBounds()
} }
_bounds = b; _bounds = b;
} else { } else {
qWarning("%s: missing bounds metadata", qPrintable(path())); qWarning("%s: missing bounds metadata", qUtf8Printable(path()));
int z = _zoomsBase.first().z; int z = _zoomsBase.first().z;
QString sql = QString("SELECT min(tile_column), min(tile_row), " QString sql = QString("SELECT min(tile_column), min(tile_row), "
@ -156,7 +156,7 @@ void MBTilesMap::getTileFormat()
if (query.value(0).toString() == "pbf") if (query.value(0).toString() == "pbf")
_scalable = true; _scalable = true;
} else } else
qWarning("%s: missing tiles format metadata", qPrintable(path())); qWarning("%s: missing tiles format metadata", qUtf8Printable(path()));
} }
void MBTilesMap::getTilePixelRatio() void MBTilesMap::getTilePixelRatio()
@ -177,7 +177,7 @@ void MBTilesMap::getName()
if (query.first()) if (query.first())
_name = query.value(0).toString(); _name = query.value(0).toString();
else { else {
qWarning("%s: missing map name", qPrintable(path())); qWarning("%s: missing map name", qUtf8Printable(path()));
_name = Util::file2name(path()); _name = Util::file2name(path());
} }
} }

View File

@ -514,8 +514,8 @@ QPixmap OruxMap::tile(const Zoom &z, int x, int y) const
query.exec(); query.exec();
if (!query.first()) { if (!query.first()) {
qWarning("%s: SQL %d-%d-%d: not found", qPrintable(name()), z.zoom, qWarning("%s: SQL %d-%d-%d: not found", qUtf8Printable(name()),
x, y); z.zoom, x, y);
return QPixmap(); return QPixmap();
} else { } else {
QImage img(QImage::fromData(query.value(0).toByteArray())); QImage img(QImage::fromData(query.value(0).toByteArray()));
@ -526,8 +526,8 @@ QPixmap OruxMap::tile(const Zoom &z, int x, int y) const
+ QString::number(y) + ".omc2"); + QString::number(y) + ".omc2");
QString path(z.set.absoluteFilePath(fileName)); QString path(z.set.absoluteFilePath(fileName));
if (!QFileInfo::exists(path)) { if (!QFileInfo::exists(path)) {
qWarning("%s: %s: not found", qPrintable(name()), qWarning("%s: %s: not found", qUtf8Printable(name()),
qPrintable(fileName)); qUtf8Printable(fileName));
return QPixmap(); return QPixmap();
} else { } else {
QImage img(path); QImage img(path);

View File

@ -117,7 +117,7 @@ bool OZF::readHeaders()
if (!initOZF3()) if (!initOZF3())
return false; return false;
} else { } else {
qWarning("%s: not a OZF2/OZF3 file", qPrintable(_file.fileName())); qWarning("%s: not a OZF2/OZF3 file", qUtf8Printable(_file.fileName()));
return false; return false;
} }

View File

@ -288,7 +288,7 @@ bool OziMap::setTileInfo(const QStringList &tiles, const QString &path)
if (_tile.size.isValid()) if (_tile.size.isValid())
return true; return true;
else else
qWarning("%s: error reading tile image", qPrintable(tile)); qWarning("%s: error reading tile image", qUtf8Printable(tile));
} }
} }
@ -310,16 +310,16 @@ void OziMap::load(const Projection &in, const Projection &out,
if (_tar) { if (_tar) {
Q_ASSERT(!_tar->isOpen()); Q_ASSERT(!_tar->isOpen());
if (!_tar->open()) { if (!_tar->open()) {
qWarning("%s: %s", qPrintable(_tar->fileName()), qWarning("%s: %s", qUtf8Printable(_tar->fileName()),
qPrintable(_tar->errorString())); qUtf8Printable(_tar->errorString()));
return; return;
} }
} }
if (_ozf) { if (_ozf) {
Q_ASSERT(!_ozf->isOpen()); Q_ASSERT(!_ozf->isOpen());
if (!_ozf->open()) { if (!_ozf->open()) {
qWarning("%s: %s", qPrintable(_ozf->fileName()), qWarning("%s: %s", qUtf8Printable(_ozf->fileName()),
qPrintable(_ozf->errorString())); qUtf8Printable(_ozf->errorString()));
return; return;
} }
} }
@ -370,7 +370,7 @@ void OziMap::drawTiled(QPainter *painter, const QRectF &rect) const
pixmap = QPixmap(tileName); pixmap = QPixmap(tileName);
if (pixmap.isNull()) if (pixmap.isNull())
qWarning("%s: error loading tile image", qPrintable(tileName)); qWarning("%s: error loading tile image", qUtf8Printable(tileName));
else { else {
pixmap.setDevicePixelRatio(_mapRatio); pixmap.setDevicePixelRatio(_mapRatio);
QPointF tp(tl.x() + i * ts.width(), tl.y() + j * ts.height()); QPointF tp(tl.x() + i * ts.width(), tl.y() + j * ts.height());
@ -404,7 +404,7 @@ void OziMap::drawOZF(QPainter *painter, const QRectF &rect) const
} }
if (pixmap.isNull()) if (pixmap.isNull())
qWarning("%s: error loading tile image", qPrintable(key)); qWarning("%s: error loading tile image", qUtf8Printable(key));
else { else {
pixmap.setDevicePixelRatio(_mapRatio); pixmap.setDevicePixelRatio(_mapRatio);
QPointF tp(tl.x() + i * ts.width(), tl.y() + j * ts.height()); QPointF tp(tl.x() + i * ts.width(), tl.y() + j * ts.height());

View File

@ -31,17 +31,18 @@ bool PCS::loadList(const QString &path)
bool res; bool res;
if (!file.open(QFile::ReadOnly)) { if (!file.open(QFile::ReadOnly)) {
qWarning("%s: %s", qPrintable(path), qPrintable(file.errorString())); qWarning("%s: %s", qUtf8Printable(path),
qUtf8Printable(file.errorString()));
return false; return false;
} }
while (!csv.atEnd()) { while (!csv.atEnd()) {
if (!csv.readEntry(entry)) { if (!csv.readEntry(entry)) {
qWarning("%s:%d: Parse error", qPrintable(path), csv.line()); qWarning("%s:%d: Parse error", qUtf8Printable(path), csv.line());
return false; return false;
} }
if (entry.size() < 4) { if (entry.size() < 4) {
qWarning("%s:%d: Invalid column count", qPrintable(path), qWarning("%s:%d: Invalid column count", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
return false; return false;
} }
@ -49,30 +50,30 @@ bool PCS::loadList(const QString &path)
QString name(entry.at(0)); QString name(entry.at(0));
int id = entry.at(1).toInt(&res); int id = entry.at(1).toInt(&res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid PCS code", qPrintable(path), qWarning("%s:%d: Invalid PCS code", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
continue; continue;
} }
int gcs = entry.at(2).toInt(&res); int gcs = entry.at(2).toInt(&res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid GCS code", qPrintable(path), qWarning("%s:%d: Invalid GCS code", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
continue; continue;
} }
int proj = entry.at(3).toInt(&res); int proj = entry.at(3).toInt(&res);
if (!res) { if (!res) {
qWarning("%s:%d: Invalid projection code", qPrintable(path), qWarning("%s:%d: Invalid projection code", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
continue; continue;
} }
if (GCS::gcs(gcs).isNull()) { if (GCS::gcs(gcs).isNull()) {
qWarning("%s:%d: Unknown GCS code", qPrintable(path), qWarning("%s:%d: Unknown GCS code", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
continue; continue;
} }
if (Conversion::conversion(proj).isNull()) { if (Conversion::conversion(proj).isNull()) {
qWarning("%s:%d: Unknown projection code", qPrintable(path), qWarning("%s:%d: Unknown projection code", qUtf8Printable(path),
csv.line() - 1); csv.line() - 1);
continue; continue;
} }

View File

@ -28,7 +28,7 @@ static Conversion::Method projectionMethod(const QString &name)
if (!name.compare(methods[i].name, Qt::CaseInsensitive)) if (!name.compare(methods[i].name, Qt::CaseInsensitive))
return methods[i].id; return methods[i].id;
qWarning("%s: unknown projection", qPrintable(name)); qWarning("%s: unknown projection", qUtf8Printable(name));
return Conversion::Method(); return Conversion::Method();
} }
@ -66,7 +66,7 @@ static void setParameter(Conversion::Setup *setup, const QString &name,
else if (!name.compare("azimuth", Qt::CaseInsensitive)) else if (!name.compare("azimuth", Qt::CaseInsensitive))
setup->setStandardParallel2(val); setup->setStandardParallel2(val);
else else
qWarning("%s: unknown projection parameter", qPrintable(name)); qWarning("%s: unknown projection parameter", qUtf8Printable(name));
} }
PRJFile::Token PRJFile::keyword(CTX &ctx) PRJFile::Token PRJFile::keyword(CTX &ctx)

View File

@ -362,8 +362,8 @@ void QCTMap::load(const Projection &in, const Projection &out,
_mapRatio = hidpi ? deviceRatio : 1.0; _mapRatio = hidpi ? deviceRatio : 1.0;
if (!_file.open(QIODevice::ReadOnly)) if (!_file.open(QIODevice::ReadOnly))
qWarning("%s: %s", qPrintable(_file.fileName()), qWarning("%s: %s", qUtf8Printable(_file.fileName()),
qPrintable(_file.errorString())); qUtf8Printable(_file.errorString()));
} }
void QCTMap::unload() void QCTMap::unload()
@ -483,7 +483,7 @@ void QCTMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
} }
if (pixmap.isNull()) if (pixmap.isNull())
qWarning("%s: error loading tile image", qPrintable(key)); qWarning("%s: error loading tile image", qUtf8Printable(key));
else { else {
pixmap.setDevicePixelRatio(_mapRatio); pixmap.setDevicePixelRatio(_mapRatio);
QPointF tp(tl.x() + i * ts.width(), tl.y() + j * ts.height()); QPointF tp(tl.x() + i * ts.width(), tl.y() + j * ts.height());

View File

@ -366,8 +366,8 @@ void RMap::load(const Projection &in, const Projection &out, qreal deviceRatio,
_mapRatio = hidpi ? deviceRatio : 1.0; _mapRatio = hidpi ? deviceRatio : 1.0;
if (!_file.open(QIODevice::ReadOnly)) if (!_file.open(QIODevice::ReadOnly))
qWarning("%s: %s", qPrintable(_file.fileName()), qWarning("%s: %s", qUtf8Printable(_file.fileName()),
qPrintable(_file.errorString())); qUtf8Printable(_file.errorString()));
} }
void RMap::unload() void RMap::unload()
@ -455,7 +455,7 @@ void RMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
} }
if (pixmap.isNull()) if (pixmap.isNull())
qWarning("%s: error loading tile image", qPrintable(key)); qWarning("%s: error loading tile image", qUtf8Printable(key));
else { else {
pixmap.setDevicePixelRatio(_mapRatio); pixmap.setDevicePixelRatio(_mapRatio);
QPointF tp(tl.x() + i * ts.width(), tl.y() + j * ts.height()); QPointF tp(tl.x() + i * ts.width(), tl.y() + j * ts.height());

View File

@ -103,7 +103,7 @@ bool Tar::loadTmi(const QString &path)
QByteArray line(file.readLine(4096)); QByteArray line(file.readLine(4096));
int pos = line.indexOf(':'); int pos = line.indexOf(':');
if (line.size() < 10 || pos < 7 || !line.startsWith("block")) { if (line.size() < 10 || pos < 7 || !line.startsWith("block")) {
qWarning("%s:%d: syntax error", qPrintable(path), ln); qWarning("%s:%d: syntax error", qUtf8Printable(path), ln);
_index.clear(); _index.clear();
return false; return false;
} }

View File

@ -56,7 +56,8 @@ TileLoader::TileLoader(const QString &dir, QObject *parent)
: QObject(parent), _urlType(XYZ), _dir(dir) : QObject(parent), _urlType(XYZ), _dir(dir)
{ {
if (!QDir().mkpath(_dir)) if (!QDir().mkpath(_dir))
qWarning("%s: %s", qPrintable(_dir), "Error creating tiles directory"); qWarning("%s: %s", qUtf8Printable(_dir),
"Error creating tiles directory");
_downloader = new Downloader(this); _downloader = new Downloader(this);
connect(_downloader, &Downloader::finished, this, &TileLoader::finished); connect(_downloader, &Downloader::finished, this, &TileLoader::finished);