summaryrefslogtreecommitdiff
path: root/src/location/maps/qgeofiletilecache_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Replace Q_DECL_OVERRIDE with overrideKevin Funk2018-02-051-24/+24
| | | | | Change-Id: Iaa670de181255ea570fcf7bcbe465987ef7fc2fc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix tile cache not honoring cost 0Paolo Angelelli2017-09-111-0/+4
| | | | | | | | | This patch fixes the case of disabling the various caches. Currently setting the cache size to 0 results in default initial values instead. Change-Id: I019cd15ac23b6479e4367a3e102dd661895a7fda Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Refactor: move code not depending on "this" into static methodsPaolo Angelelli2017-05-291-0/+3
| | | | | | | | | | | This patch moves the implementation of the default filenameToTileSpec and tileSpecToFileName methods into standalone public static methods so that they can be possibly reused by plugins or other components, since these implementations do not actually depend on any member of QGeoFileTileCache. Change-Id: I6e3f59615ff3a5e0924f946aa13aabebb8157e42 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add a way to skip showing tilesPaolo Angelelli2017-05-081-1/+2
| | | | | | | | | | | | | | | In certain cases servers provide tiles that can be fully transparent, provide no content or are bogus. Tile fetchers can be smart and detect some of these cases. This patch offers an extensible way to allow them to communicate (via a null QImage) tiles that should not be rendered, in addition to an extensible mechanism to identify such tiles on disk. The default way is by assuming that, once such tiles have been detected, the tile fetcher would simply write a file with "NoRetry" as content. Change-Id: I404bb4dcc38fdd33c412f7407601b47947e4ce8d Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix export macro in private headersPaolo Angelelli2017-02-141-2/+1
| | | | | | | | Changing Q_LOCATION_EXPORT to Q_LOCATION_PRIVATE_EXPORT in all _p headers to avoid confusion. Change-Id: Ic42d1c59f0cd68c27bcf40296c612d005da11efd Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Refactor: move CacheAreas to QAbstractGeoTileCachePaolo Angelelli2017-01-161-1/+1
| | | | | | | | | | | | | | | This change moves QGeoTiledMappingManagerEngine::CacheAreas to the more appropriate container that is QAbstractGeoTileCache, which already uses this enum in its interface. Together with making the virtual init() method of QAbstractGeoTileCache public, instead of protected, this patch effectively disentangle QAbstractGeoTileCache/QGeoFileTileCache from the QGeoTiledMappingManagerEngine, and makes it usable potentially also by other (tile) renderers. Change-Id: Ic635b81660f81d86884cc6b00e3a2ab9420daa9f Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Improve support for unitary tile cost in QGeoFileTileCachePaolo Angelelli2016-11-231-3/+9
| | | | | | | | | | | | | | | This patch adds support for separate caching mode for each of the three caches, disk, memory and texture. It also adds separate plugin parameters to the mapbox plugin to control the functioning of each of these cache. By default it only sets the disk cache to unitary, to comply with mapbox TOS, and leaves the other two caches to bytesize behavior (old beavior). Change-Id: I665d40568f4e69a836d7489e1daa2d8dcb8987af Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Add support for unitary tile cost in QGeoFileTileCachePaolo Angelelli2016-11-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for unitary pricing of tiles in the disk, memory and texture caches. This is done through a new enum in QAbstractGeoTileCache, "CostStrategy" having two values, Unitary (new one) and ByteSize (the old way). Using Unitary instead of ByteSize gives, as advantages: - the ability to comply with the TOS of certain providers, who allow to cache a fixed number of tiles, and not of bytes. - even performance with different types of tiles, like lo vs hi res, indexed vs satellite (which usually compresses much less). This patch sets the Unitary mode to be the default for the mapbox plugin since Mapbox is one of the providers whose TOS limit the amount of cacheable tiles. Therefore, the patch also modifies the mapbox plugin ".mapping.cache" parameters to reflect the new behavior. Since these parameters have been introduced with 5.8 (which is unreleased), the change doesn't need to be backward compatible. Change-Id: I76edd43900242885f24eb9f28e8c833538647edc Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Evict obsolete provider data on init()Paolo Angelelli2016-11-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | 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 cache mixing with high-dpi and low-dpi osm providersPaolo Angelelli2016-10-051-1/+2
| | | | | | | | | | | | | | | | | 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/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix for caching after mapbox improvement/highdpi-supportPaolo Angelelli2016-07-071-0/+1
| | | | | | | | | | Currently the qgeofiletilecache/qgeofiletilecachemapbox contains a bug in that it makes use of virtual functions in the constructor. This patch fixes it by moving those calls into a virtual init() method that is called by QGeoTiledMappingManagerEngine::setTileCache() Change-Id: Icf7932dfbae7d99eef22c67e034246a834212a03 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Improve Mapbox geoservice pluginPaolo Angelelli2016-06-301-3/+3
| | | | | | | | | | | | | | | This patch adds standard mapbox map modes so that they could be used out of the box without the need for specifying it as parameter, and also adds a QGeoFileTileCache to the plugin, since the Mapbox TOS allow a limited caching even in the free plan. The default cache max disk usage has been set accordingly. The mapbox.map_id parameter is now optional, meaning that things will work like before if present, but will work with the default mapbox styles if not. Change-Id: I4056a3706f47d7f5c46a873c135b743106647fc0 Reviewed-by: Topi Reiniƶ <topi.reinio@theqtcompany.com> Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
* Add clearData() call to map qml apiMichal Klocek2015-12-071-0/+1
| | | | | | | | | | | Add clearData call to clear texture, memory and disk cache. Update mapviewer example and add "prefetchData" and "clearData" to Tools menu. Task-number: QTBUG-47292 Change-Id: Ifc71a3652688d1403f5b011ef231b59381c17ee3 Reviewed-by: Harald Meyer <dev@meh.at> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Avoid extra QPixmap convertion when tile fetchedMichal Klocek2015-11-231-1/+1
| | | | | | | | Initialize QGeoTileTexture with QImage instead of converting from QPixmap Change-Id: I69dddda385ebc9ce63cb0dd68fee3d3fa6eed73f Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Added method to set the map cacheHarald Meyer2015-10-261-16/+16
| | | | | | | | | | | | This update adds a new method "setTileCache" to the QGeoTiledMappingManagerEngine class. The method allows custom map implementations to set their own cache. The update also fixes a compiler warning (ctor variable order) and adds Q_DECL_OVERRIDE checks. Change-Id: I22cfdb218ae5c9af145d688f11aab655f4ed3e4b Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Split QGeoTileCache for easier customization of the tile cache.Harald Meyer2015-10-221-0/+155
The QGeoTileCache is split into two classes: The abstract class QAbstractGeoTileCache offers interfaces for inserting and getting tiles, as well as getting cache status information such as used texture memory. The new class QGeoFileTileCache implements QAbstractGeoTileCache and offers a file based caching implementation (the implementation is the same as before splitting the class). Change-Id: I2eab7491d489ac5b251c1296b67688901f5cc7d7 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>