summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-04-14 13:19:41 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-04-14 13:48:36 (GMT)
commit99ed68cda10355dba5c7a3e2466ee45b59dbb555 (patch)
tree6f337b0b74d0c41b55710c0d8f344f792b749597 /src
parent56feb92927d48edffcd09491091ec735b86a820d (diff)
downloadQt-99ed68cda10355dba5c7a3e2466ee45b59dbb555.zip
Qt-99ed68cda10355dba5c7a3e2466ee45b59dbb555.tar.gz
Qt-99ed68cda10355dba5c7a3e2466ee45b59dbb555.tar.bz2
Don't remove the cache file if you have successfully added it.
This regression probably happened because of the fix to task 244485 (see 8d500381), which made QFile follow a rename. This means that QTemporaryFile removes its target when it is deleted. This fixes a number of caching autotests that are failing. Reviewed-by: Markus Goetz BT: yes
Diffstat (limited to 'src')
-rw-r--r--src/network/access/qnetworkdiskcache.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp
index fa0fccb..93360c8 100644
--- a/src/network/access/qnetworkdiskcache.cpp
+++ b/src/network/access/qnetworkdiskcache.cpp
@@ -253,7 +253,8 @@ void QNetworkDiskCachePrivate::storeItem(QCacheItem *cacheItem)
// ### use atomic rename rather then remove & rename
if (cacheItem->file->rename(fileName))
currentCacheSize += cacheItem->file->size();
- cacheItem->file->setAutoRemove(true);
+ else
+ cacheItem->file->setAutoRemove(true);
}
if (cacheItem->metaData.url() == lastItem.metaData.url())
lastItem.reset();