From 51becc4bf11e091ad0dd946ee56ad94d9cdfadb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Thu, 2 Jul 2020 23:51:15 +0200 Subject: [PATCH] Dummy non-class callback functions are not needed --- src/map/imgmap.cpp | 7 +------ src/map/mbtilesmap.cpp | 7 +------ src/map/tileloader.cpp | 9 ++------- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/map/imgmap.cpp b/src/map/imgmap.cpp index 8206f2c1..4521c996 100644 --- a/src/map/imgmap.cpp +++ b/src/map/imgmap.cpp @@ -167,11 +167,6 @@ void IMGMap::ll2xy(QList &points) } } -static void render(RasterTile &tile) -{ - tile.render(); -} - void IMGMap::draw(QPainter *painter, const QRectF &rect, Flags flags) { Q_UNUSED(flags); @@ -224,7 +219,7 @@ void IMGMap::draw(QPainter *painter, const QRectF &rect, Flags flags) } } - QFuture future = QtConcurrent::map(tiles, render); + QFuture future = QtConcurrent::map(tiles, &RasterTile::render); future.waitForFinished(); for (int i = 0; i < tiles.size(); i++) { diff --git a/src/map/mbtilesmap.cpp b/src/map/mbtilesmap.cpp index 525beb0d..63e5610a 100644 --- a/src/map/mbtilesmap.cpp +++ b/src/map/mbtilesmap.cpp @@ -49,11 +49,6 @@ private: #define META_TYPE(type) static_cast(type) -static void render(MBTile &tile) -{ - tile.load(); -} - static double index2mercator(int index, int zoom) { return rad2deg(-M_PI + 2 * M_PI * ((double)index / (1< future = QtConcurrent::map(tiles, render); + QFuture future = QtConcurrent::map(tiles, &MBTile::load); future.waitForFinished(); for (int i = 0; i < tiles.size(); i++) { diff --git a/src/map/tileloader.cpp b/src/map/tileloader.cpp index 3642ee01..9555e83c 100644 --- a/src/map/tileloader.cpp +++ b/src/map/tileloader.cpp @@ -41,11 +41,6 @@ private: QImage _image; }; -static void render(TileImage &ti) -{ - ti.load(); -} - static QString quadKey(const QPoint &xy, int zoom) { QString qk; @@ -101,7 +96,7 @@ void TileLoader::loadTilesAsync(QVector &list) if (!dl.empty()) _downloader->get(dl, _authorization); - QFuture future = QtConcurrent::map(imgs, render); + QFuture future = QtConcurrent::map(imgs, &TileImage::load); future.waitForFinished(); for (int i = 0; i < imgs.size(); i++) { @@ -153,7 +148,7 @@ void TileLoader::loadTilesSync(QVector &list) } } - QFuture future = QtConcurrent::map(imgs, render); + QFuture future = QtConcurrent::map(imgs, &TileImage::load); future.waitForFinished(); for (int i = 0; i < imgs.size(); i++)