mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-02-20 09:40:49 +01:00
Improved error reporting
This commit is contained in:
parent
db4dc37848
commit
363fc47b88
13
src/map.cpp
13
src/map.cpp
@ -14,7 +14,10 @@ Map::Map(const QString &name, const QString &url)
|
|||||||
connect(&Downloader::instance(), SIGNAL(finished()), this,
|
connect(&Downloader::instance(), SIGNAL(finished()), this,
|
||||||
SLOT(emitLoaded()));
|
SLOT(emitLoaded()));
|
||||||
|
|
||||||
QDir::home().mkpath(QString(TILES_DIR"/%1").arg(_name));
|
if (!QDir::home().mkpath(QString(TILES_DIR"/%1").arg(_name)))
|
||||||
|
fprintf(stderr, "Error creating tiles dir: %s\n",
|
||||||
|
qPrintable(QDir::home().absolutePath() + QString("/"TILES_DIR"/%1")
|
||||||
|
.arg(_name)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Map::emitLoaded()
|
void Map::emitLoaded()
|
||||||
@ -33,9 +36,11 @@ void Map::loadTiles(QList<Tile> &list)
|
|||||||
.arg(t.xy().ry());
|
.arg(t.xy().ry());
|
||||||
QFileInfo fi(file);
|
QFileInfo fi(file);
|
||||||
|
|
||||||
if (fi.exists())
|
if (fi.exists()) {
|
||||||
t.pixmap().load(file);
|
if (!t.pixmap().load(file))
|
||||||
else {
|
fprintf(stderr, "Error loading map tile: %s\n",
|
||||||
|
qPrintable(file));
|
||||||
|
} else {
|
||||||
t.pixmap() = QPixmap(TILE_SIZE, TILE_SIZE);
|
t.pixmap() = QPixmap(TILE_SIZE, TILE_SIZE);
|
||||||
t.pixmap().fill();
|
t.pixmap().fill();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user