diff options
author | Niklas Kurkisuo <ext-niklas.kurkisuo@nokia.com> | 2011-01-10 11:17:27 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2011-01-10 11:17:27 (GMT) |
commit | 7471178137e6fcc193ba55acdfb2bbeed33f8e7a (patch) | |
tree | 7ed66cf627402e71d0a00f9c1efa1e84c86bd978 /src/network/kernel | |
parent | 963ada5805d61e318a04295b6d06e527b49cdb7a (diff) | |
download | Qt-7471178137e6fcc193ba55acdfb2bbeed33f8e7a.zip Qt-7471178137e6fcc193ba55acdfb2bbeed33f8e7a.tar.gz Qt-7471178137e6fcc193ba55acdfb2bbeed33f8e7a.tar.bz2 |
Change QHostInfoCache to use QElapsedTime instead of QTime.
Use QElapsedTime instead of QTime for performance gain. See QT-2965 for
more info.
Task-number: QTBUG-16468
Reviewed-by: Markus Goetz
Diffstat (limited to 'src/network/kernel')
-rw-r--r-- | src/network/kernel/qhostinfo.cpp | 2 | ||||
-rw-r--r-- | src/network/kernel/qhostinfo_p.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index f984cf8..0c0e1cd 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -740,7 +740,7 @@ void QHostInfoCache::put(const QString &name, const QHostInfo &info) QHostInfoCacheElement* element = new QHostInfoCacheElement(); element->info = info; - element->age = QTime(); + element->age = QElapsedTimer(); element->age.start(); QMutexLocker locker(&this->mutex); diff --git a/src/network/kernel/qhostinfo_p.h b/src/network/kernel/qhostinfo_p.h index 85d14c2..8814bd8 100644 --- a/src/network/kernel/qhostinfo_p.h +++ b/src/network/kernel/qhostinfo_p.h @@ -68,7 +68,7 @@ #include "QtCore/qrunnable.h" #include "QtCore/qlist.h" #include "QtCore/qqueue.h" -#include <QTime> +#include <QElapsedTimer> #include <QCache> #endif @@ -135,7 +135,7 @@ private: bool enabled; struct QHostInfoCacheElement { QHostInfo info; - QTime age; + QElapsedTimer age; }; QCache<QString,QHostInfoCacheElement> cache; QMutex mutex; |