From e70502b14a6b78067c18a4645570c077453c34ea Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Wed, 18 Nov 2015 19:21:21 +0100 Subject: Add clearData() call to map qml api 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 Reviewed-by: Alex Blasche --- src/imports/location/qdeclarativegeomap.cpp | 12 ++++++++++++ src/imports/location/qdeclarativegeomap_p.h | 1 + 2 files changed, 13 insertions(+) (limited to 'src/imports') diff --git a/src/imports/location/qdeclarativegeomap.cpp b/src/imports/location/qdeclarativegeomap.cpp index d9981b69..80208a9b 100644 --- a/src/imports/location/qdeclarativegeomap.cpp +++ b/src/imports/location/qdeclarativegeomap.cpp @@ -907,6 +907,18 @@ void QDeclarativeGeoMap::prefetchData() m_map->prefetchData(); } +/*! + \qmlmethod void QtLocation::Map::clearData() + + Clears map data collected by the currently selected plugin. + \note This method will delete cached files. + \sa plugin +*/ +void QDeclarativeGeoMap::clearData() +{ + m_map->clearData(); +} + /*! \qmlproperty string QtLocation::Map::errorString diff --git a/src/imports/location/qdeclarativegeomap_p.h b/src/imports/location/qdeclarativegeomap_p.h index 22450ec1..fb36104a 100644 --- a/src/imports/location/qdeclarativegeomap_p.h +++ b/src/imports/location/qdeclarativegeomap_p.h @@ -127,6 +127,7 @@ public: Q_INVOKABLE void fitViewportToMapItems(); Q_INVOKABLE void pan(int dx, int dy); Q_INVOKABLE void prefetchData(); // optional hint for prefetch + Q_INVOKABLE void clearData(); QString errorString() const; QGeoServiceProvider::Error error() const; -- cgit v1.2.1