1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

Added missing cache insert

This commit is contained in:
Martin Tůma 2023-05-06 16:14:49 +02:00
parent 190a961242
commit ca6c7247c0
2 changed files with 7 additions and 1 deletions

View File

@ -61,6 +61,7 @@ TileLoader::TileLoader(const QString &dir, QObject *parent)
connect(_downloader, &Downloader::finished, this, &TileLoader::finished); connect(_downloader, &Downloader::finished, this, &TileLoader::finished);
} }
void TileLoader::loadTilesAsync(QVector<FetchTile> &list) void TileLoader::loadTilesAsync(QVector<FetchTile> &list)
{ {
QList<Download> dl; QList<Download> dl;
@ -142,6 +143,11 @@ void TileLoader::loadTilesSync(QVector<FetchTile> &list)
QFuture<void> future = QtConcurrent::map(imgs, &TileImage::load); QFuture<void> future = QtConcurrent::map(imgs, &TileImage::load);
future.waitForFinished(); future.waitForFinished();
for (int i = 0; i < imgs.size(); i++) {
TileImage &ti = imgs[i];
QPixmapCache::insert(ti.file(), ti.tile()->pixmap());
}
} }
void TileLoader::clearCache() void TileLoader::clearCache()