diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-12-11 14:57:11 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-01-15 09:06:27 +0000 |
commit | 2b6020a59ef503eeadabc532782f5e9e795fcf3f (patch) | |
tree | 2163c77dd21fef3ad21c650c3e68da1a3dea4a7e /src/location/maps/qgeotiledmap.cpp | |
parent | 7b8ab37beaafbe27c258a6d80d1914f982dcc9e1 (diff) | |
download | qtlocation-2b6020a59ef503eeadabc532782f5e9e795fcf3f.tar.gz |
Fix performance issue with copyright notice
Skip evaluating copyrights when the notice is not visible.
The implication of this patch is that copyright information
won't be up to date or even available unless there is an
"attached" copyright notice that has the visible property
set to true.
Task-number: QTBUG-64880
Change-Id: I3750b61913becb0cbf31273ad9a76ae1a2b6a393
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/maps/qgeotiledmap.cpp')
-rw-r--r-- | src/location/maps/qgeotiledmap.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/location/maps/qgeotiledmap.cpp b/src/location/maps/qgeotiledmap.cpp index 0eeb189d..815a8b99 100644 --- a/src/location/maps/qgeotiledmap.cpp +++ b/src/location/maps/qgeotiledmap.cpp @@ -143,6 +143,17 @@ void QGeoTiledMap::clearData() d->m_mapScene->clearTexturedTiles(); } +void QGeoTiledMap::setCopyrightVisible(bool visible) +{ + Q_D(QGeoTiledMap); + if (visible == d->m_copyrightVisible) + return; + + QGeoMap::setCopyrightVisible(visible); + if (visible) + evaluateCopyrights(d->m_mapScene->visibleTiles()); +} + void QGeoTiledMap::clearScene(int mapId) { Q_D(QGeoTiledMap); @@ -319,7 +330,7 @@ void QGeoTiledMapPrivate::updateScene() bool newTilesIntroduced = !m_mapScene->visibleTiles().contains(tiles); m_mapScene->setVisibleTiles(tiles); - if (newTilesIntroduced) + if (newTilesIntroduced && m_copyrightVisible) q->evaluateCopyrights(tiles); // don't request tiles that are already built and textured @@ -381,7 +392,8 @@ void QGeoTiledMapPrivate::changeViewportSize(const QSize& size) m_cache->setMinTextureUsage(newSize); } - q->evaluateCopyrights(m_visibleTiles->createTiles()); + if (m_copyrightVisible) + q->evaluateCopyrights(m_mapScene->visibleTiles()); updateScene(); } |