diff --git a/src/GUI/mapview.cpp b/src/GUI/mapview.cpp index f2a2d9b1..9bdf0f0e 100644 --- a/src/GUI/mapview.cpp +++ b/src/GUI/mapview.cpp @@ -351,7 +351,6 @@ void MapView::setMap(Map *map) centerOn(nc); reloadMap(); - QPixmapCache::clear(); } void MapView::setPOI(POI *poi) @@ -982,7 +981,6 @@ void MapView::setDevicePixelRatio(qreal deviceRatio, qreal mapRatio) _deviceRatio = deviceRatio; _mapRatio = mapRatio; - QPixmapCache::clear(); QRectF vr(mapToScene(viewport()->rect()).boundingRect() .intersected(_map->bounds())); diff --git a/src/map/tileloader.cpp b/src/map/tileloader.cpp index b677fa3c..3642ee01 100644 --- a/src/map/tileloader.cpp +++ b/src/map/tileloader.cpp @@ -169,6 +169,17 @@ void TileLoader::clearCache() dir.remove(list.at(i)); _downloader->clearErrors(); + + QPixmapCache::clear(); +} + +void TileLoader::setScaledSize(int size) +{ + if (_scaledSize == size) + return; + + _scaledSize = size; + QPixmapCache::clear(); } QUrl TileLoader::tileUrl(const Tile &tile) const diff --git a/src/map/tileloader.h b/src/map/tileloader.h index ee2bd71a..d12ba6c4 100644 --- a/src/map/tileloader.h +++ b/src/map/tileloader.h @@ -16,7 +16,7 @@ public: void setUrl(const QString &url) {_url = url;} void setAuthorization(const Authorization &authorization) {_authorization = authorization;} - void setScaledSize(int size) {_scaledSize = size;} + void setScaledSize(int size); void setQuadTiles(bool quadTiles) {_quadTiles = quadTiles;} void loadTilesAsync(QVector &list);