summaryrefslogtreecommitdiff
path: root/src/imports
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@theqtcompany.com>2015-11-18 19:21:21 +0100
committerMichal Klocek <michal.klocek@theqtcompany.com>2015-12-07 11:11:37 +0000
commite70502b14a6b78067c18a4645570c077453c34ea (patch)
treee93850d0ee06cd1d1b220e123dea81f6eb630739 /src/imports
parent3faac8cc62a9101902baebbda348e7da9921cce4 (diff)
downloadqtlocation-e70502b14a6b78067c18a4645570c077453c34ea.tar.gz
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 <dev@meh.at> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/location/qdeclarativegeomap.cpp12
-rw-r--r--src/imports/location/qdeclarativegeomap_p.h1
2 files changed, 13 insertions, 0 deletions
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
@@ -908,6 +908,18 @@ void QDeclarativeGeoMap::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
This read-only property holds the textual presentation of the latest mapping provider error.
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;