mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-02-26 04:00:49 +01:00
Added missing cache insert
This commit is contained in:
parent
190a961242
commit
ca6c7247c0
@ -17,7 +17,7 @@ public:
|
|||||||
const QVariant &zoom() const {return _zoom;}
|
const QVariant &zoom() const {return _zoom;}
|
||||||
const QPoint &xy() const {return _xy;}
|
const QPoint &xy() const {return _xy;}
|
||||||
const RectD &bbox() const {return _bbox;}
|
const RectD &bbox() const {return _bbox;}
|
||||||
QPixmap& pixmap() {return _pixmap;}
|
QPixmap &pixmap() {return _pixmap;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPoint _xy;
|
QPoint _xy;
|
||||||
|
@ -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…
x
Reference in New Issue
Block a user