summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Unify semicolon usage in Q_UNUSEDJesus Fernandez2019-01-231-2/+2
| | | | | Change-Id: I36dd6881b6f6f028869d63b6311cba7f52a99cc4 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Remove indexing of offline data from OSM pluginPaolo Angelelli2018-07-261-99/+38
| | | | | | | | | With this patch, offline tiles will be looked up on the fly, thus removing the need to index the offline content at startup. Task-number: QTBUG-59665 Change-Id: I1db62c38363dafe82ee2f2ffc7f493ac5d958fc2 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Reduce the amount of mutexed codePaolo Angelelli2017-02-281-2/+3
| | | | | Change-Id: Ic0dfe488ba8aafb0f3ca3a2b6209d59484d07af8 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix incorrect handling of provider resolution for offline storagePaolo Angelelli2017-02-281-29/+43
| | | | | | | | | | | This patch fixes the incorrect handling of the population/repopulation of OSM offline tiles when the providers are initially populated. In this way it is now fine if the user selects high dpi tiles, and has both high dpi and low dpi offline tiles, and the high dpi provider is unavailable. Change-Id: I4d7080d6f259663bf6ca7a985fd9784fb81cfec3 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix for index OOBPaolo Angelelli2017-01-271-0/+3
| | | | | | | Adding a range check to prevent an index OOB error. Change-Id: I9d2d13f27755511893a0731f3cf0bb934b0a8795 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Prevent destroying QGeoTileProviderOsm before QGeoFileTileCacheOsmPaolo Angelelli2017-01-171-0/+1
| | | | | | | | | | | | | | Parenting QGeoTileProviderOsm under QGeoMappingManagerEngine puts them at the same level in the qobject tree as QGeoFileTileCacheOsm. Since the latter uses the providers in the destructor, it might end up calling the destructor with providers already destroyed. This patch parents the providers under the file tile cache, so that they will be destroyed after the cache. Task-number: QTBUG-58124 Change-Id: Id2fc04da58e1ba9c80a4b6c4ebeaf98cccc7d872 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Evict obsolete provider data on init()Paolo Angelelli2016-11-081-8/+101
| | | | | | | | | | | | | | | | | | | | | | During initialization, this patch makes sure that the cached tiles belong to the provider currently in use by using the file lastModified() value and comparing it against the (optional) Timestamp in the provider records. If this value is not present in the provider record, or if it is older than the newest modified file, the data is untouched. This operation is performed separately for each map id. This method isn't perfect in all use cases, though. E.g., if we are forced to shut down one of the provider and run on the hardcoded fallback, which has an older TS. These are however rare edge cases that most likely won't happen in practice (in the case above we could put the content of the hardcoded provider in the remote json files too) Change-Id: Ie29cf05c1fbc835ce4e3363fc0caa38a97800214 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix assignment-as-condition warningErik Verbruggen2016-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | qgeofiletilecacheosm.cpp:71:12: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] if (tt = getFromOfflineStorage(spec)) ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ qgeofiletilecacheosm.cpp:71:12: note: place parentheses around the assignment to silence this warning if (tt = getFromOfflineStorage(spec)) ^ ( ) qgeofiletilecacheosm.cpp:71:12: note: use '==' to turn this assignment into an equality comparison if (tt = getFromOfflineStorage(spec)) ^ == Assuming this is not meant to be a comparisson but a check if the return value is not-0, I added the parentheses. Change-Id: Ic4e14d7ea8cc5283c70d061433fe482ee4e8b38b Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix cache mixing with high-dpi and low-dpi osm providersPaolo Angelelli2016-10-051-3/+139
| | | | | | | | | | | | | | | | | This cache fixes the cache mixing problem that has been introduced with the osm high dpi tiles support. high dpi providers fall back to low dpi ones and ultimately to hardcoded providers (also low dpi), and can also be enabled/disabled via plugin parameter, thus leaving the cache for a given map id dirty for the next run. With this patch high dpi tiles are named differently from low dpi ones. If high-dpi providers are selected, but become not available, the cache can also change the tileset to load at runtime Change-Id: I229692da07c1fc61c58fb0b6fae6ec5af16e43a7 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* OSM Geoservice plugin improvements, including offline data supportPaolo Angelelli2016-07-211-0/+131
This patch contains improvements for the OSM geoservice plugin, in form of property-controllable disk cache, and the support for a directory containing an offline dataset. The offline directory can contain subdirectories also in form of symlinks. If duplicate tiles are present, the newest is used. The population of the offline tiles registry is offloaded to a thread to prevent blocking the startup of the application. No synchronization is used (except on cache destruction), so that, as the tiles are being indexed, they can be used in the application. For the time being, no support is given to populate such directory (mostly due to current API limitations), but tiles can be placed manually, for example copying them from the disk cache directory. Task-number: QTBUG-45284 Change-Id: I518980669a3ee474545025adf05adc69cdd29781 Reviewed-by: Paolo Angelelli <paolo.angelelli@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>