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:
parent
190a961242
commit
ca6c7247c0
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user