projects
/
situare
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3d5cb85
)
Added tile expiration date check to MapFetcher.
author
Jussi Laitinen
<jupe@l3l7588.ixonos.local>
Thu, 22 Apr 2010 05:42:33 +0000
(08:42 +0300)
committer
Jussi Laitinen
<jupe@l3l7588.ixonos.local>
Thu, 22 Apr 2010 05:42:33 +0000
(08:42 +0300)
src/map/mapfetcher.cpp
patch
|
blob
|
history
diff --git
a/src/map/mapfetcher.cpp
b/src/map/mapfetcher.cpp
index
7ee67eb
..
a7de3f8
100644
(file)
--- a/
src/map/mapfetcher.cpp
+++ b/
src/map/mapfetcher.cpp
@@
-69,7
+69,20
@@
bool MapFetcher::loadImageFromCache(const QUrl &url)
bool imageFound = false;
- if (m_manager->cache()) {
+ QAbstractNetworkCache *cache = m_manager->cache();
+
+ if (cache) {
+
+ QNetworkCacheMetaData metaData = cache->metaData(url);
+
+ if (metaData.expirationDate().isValid()) {
+
+ if (metaData.expirationDate() < QDateTime::currentDateTime()) {
+ cache->remove(url);
+ return false;
+ }
+ }
+
QIODevice *cacheImage = m_manager->cache()->data(url);
if (cacheImage) {