diff options
author | Benjamin C Meyer <benjamin.meyer@torchmobile.com> | 2009-04-29 15:15:25 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-05-18 14:23:45 (GMT) |
commit | e5755e131952ab5c3c8dd0fd6a88dbaa7148898a (patch) | |
tree | 6808d3cf1087d813a37e12e894ff47d399427506 /tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp | |
parent | ef310a8cf2067a2fe21d6812cf34fb8aaad74f48 (diff) | |
download | Qt-e5755e131952ab5c3c8dd0fd6a88dbaa7148898a.zip Qt-e5755e131952ab5c3c8dd0fd6a88dbaa7148898a.tar.gz Qt-e5755e131952ab5c3c8dd0fd6a88dbaa7148898a.tar.bz2 |
Fix QNetworkDiskCache to expire the oldest files first.
When expiring cache files use a QMultiMap, when using a QMap not all
files are put into the map because often many files (downloaded or
updated at the same time) will have the same creation QDateTime and
so only one will go into the QMap who's key is QDateTime.
Reviewed-By: Thiago Macieira
Reviewed-By: Peter Hartmann
Diffstat (limited to 'tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp')
-rw-r--r-- | tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp b/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp index fc15437..2383767 100644 --- a/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp +++ b/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp @@ -389,7 +389,8 @@ void tst_QNetworkDiskCache::expire() qint64 max = cache.maximumCacheSize(); QCOMPARE(max, limit); for (int i = 0; i < 10; ++i) { - QTest::qWait(2000); + if (i % 3 == 0) + QTest::qWait(2000); QNetworkCacheMetaData m; m.setUrl(QUrl("http://www.foo.com/" + QString::number(i))); QIODevice *d = cache.prepare(m); |