summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeir Vattekar <geir.vattekar@trolltech.com>2009-05-06 14:51:21 (GMT)
committerGeir Vattekar <geir.vattekar@trolltech.com>2009-05-06 14:51:21 (GMT)
commit85f6350812d5a22c496c66f4f91ea8e36e454561 (patch)
tree740f099380184460a99f9c2c36646e19e08778d8
parent92f2815bf45a67ec8c6b94ca26fb8598a07a6de2 (diff)
parentec8fef8f17ac69bacc3d250a0d5932c336276bc5 (diff)
downloadQt-85f6350812d5a22c496c66f4f91ea8e36e454561.zip
Qt-85f6350812d5a22c496c66f4f91ea8e36e454561.tar.gz
Qt-85f6350812d5a22c496c66f4f91ea8e36e454561.tar.bz2
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.5
-rw-r--r--src/network/access/qnetworkdiskcache.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp
index 93360c8..892929e 100644
--- a/src/network/access/qnetworkdiskcache.cpp
+++ b/src/network/access/qnetworkdiskcache.cpp
@@ -191,7 +191,11 @@ QIODevice *QNetworkDiskCache::prepare(const QNetworkCacheMetaData &metaData)
} else {
QString templateName = d->tmpCacheFileName();
cacheItem->file = new QTemporaryFile(templateName, &cacheItem->data);
- cacheItem->file->open();
+ if (!cacheItem->file->open()) {
+ qWarning() << "QNetworkDiskCache::prepare() unable to open temporary file";
+ delete cacheItem;
+ return 0;
+ }
cacheItem->writeHeader(cacheItem->file);
device = cacheItem->file;
}
@@ -229,7 +233,7 @@ void QNetworkDiskCachePrivate::storeItem(QCacheItem *cacheItem)
if (QFile::exists(fileName)) {
if (!QFile::remove(fileName)) {
- qWarning() << "QNetworkDiskCache: could't remove the cache file " << fileName;
+ qWarning() << "QNetworkDiskCache: couldn't remove the cache file " << fileName;
return;
}
}