diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-02-26 14:02:26 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-03-17 10:54:19 (GMT) |
commit | 21983be486af0d252b8d393ed36b15becb3c8824 (patch) | |
tree | 84501a18ef84aac2f186452741ac93f229090894 | |
parent | e0c97f943e80488c7e674075d40a27822b7e8c78 (diff) | |
download | Qt-21983be486af0d252b8d393ed36b15becb3c8824.zip Qt-21983be486af0d252b8d393ed36b15becb3c8824.tar.gz Qt-21983be486af0d252b8d393ed36b15becb3c8824.tar.bz2 |
Rename QTimestamp to QElapsedTimer
44 files changed, 153 insertions, 153 deletions
diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h index 3eb4948..2282cdb 100644 --- a/src/corelib/animation/qabstractanimation_p.h +++ b/src/corelib/animation/qabstractanimation_p.h @@ -56,7 +56,7 @@ #include <QtCore/qbasictimer.h> #include <QtCore/qdatetime.h> #include <QtCore/qtimer.h> -#include <QtCore/qtimestamp.h> +#include <QtCore/qelapsedtimer.h> #include <private/qobject_p.h> #ifdef Q_OS_WIN @@ -114,7 +114,7 @@ private: Q_DECLARE_PUBLIC(QAbstractAnimation) }; -typedef QTimestamp ElapsedTimer; +typedef QElapsedTimer ElapsedTimer; class QUnifiedTimer : public QObject { diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index 6250094..63c2ab8 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -88,7 +88,7 @@ QT_END_NAMESPACE #include "qprocess_p.h" #include <qbytearray.h> -#include <qtimestamp.h> +#include <qelapsedtimer.h> #include <qcoreapplication.h> #include <qsocketnotifier.h> #include <qtimer.h> @@ -1639,7 +1639,7 @@ bool QProcess::waitForBytesWritten(int msecs) if (d->processState == QProcess::NotRunning) return false; if (d->processState == QProcess::Starting) { - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); bool started = waitForStarted(msecs); if (!started) @@ -1676,7 +1676,7 @@ bool QProcess::waitForFinished(int msecs) if (d->processState == QProcess::NotRunning) return false; if (d->processState == QProcess::Starting) { - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); bool started = waitForStarted(msecs); if (!started) diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 511154a..216c382 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -100,7 +100,7 @@ QT_END_NAMESPACE #include <qsemaphore.h> #include <qsocketnotifier.h> #include <qthread.h> -#include <qtimestamp.h> +#include <qelapsedtimer.h> #include <errno.h> #include <stdlib.h> @@ -933,7 +933,7 @@ bool QProcessPrivate::waitForReadyRead(int msecs) qDebug("QProcessPrivate::waitForReadyRead(%d)", msecs); #endif - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); forever { @@ -1005,7 +1005,7 @@ bool QProcessPrivate::waitForBytesWritten(int msecs) qDebug("QProcessPrivate::waitForBytesWritten(%d)", msecs); #endif - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); while (!writeBuffer.isEmpty()) { @@ -1072,7 +1072,7 @@ bool QProcessPrivate::waitForFinished(int msecs) qDebug("QProcessPrivate::waitForFinished(%d)", msecs); #endif - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); forever { diff --git a/src/corelib/kernel/qcore_unix.cpp b/src/corelib/kernel/qcore_unix.cpp index 9146923..e0d92c0 100644 --- a/src/corelib/kernel/qcore_unix.cpp +++ b/src/corelib/kernel/qcore_unix.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "qcore_unix_p.h" -#include "qtimestamp.h" +#include "qelapsedtimer.h" #ifndef Q_OS_VXWORKS # if !defined(Q_OS_HPUX) || defined(__ia64) @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE static inline bool time_update(struct timeval *tv, const struct timeval &start, const struct timeval &timeout) { - if (!QTimestamp::isMonotonic()) { + if (!QElapsedTimer::isMonotonic()) { // we cannot recalculate the timeout without a monotonic clock as the time may have changed return false; } diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h index 59d66f7..439ca5a 100644 --- a/src/corelib/kernel/qcore_unix_p.h +++ b/src/corelib/kernel/qcore_unix_p.h @@ -314,7 +314,7 @@ static inline pid_t qt_safe_waitpid(pid_t pid, int *status, int options) # define _POSIX_MONOTONIC_CLOCK -1 #endif -timeval qt_gettime(); // in qtimestamp_mac.cpp or qtimestamp_unix.cpp +timeval qt_gettime(); // in qelapsedtimer_mac.cpp or qtimestamp_unix.cpp Q_CORE_EXPORT int qt_safe_select(int nfds, fd_set *fdread, fd_set *fdwrite, fd_set *fdexcept, const struct timeval *tv); diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 3d6364b..8fc3fb8 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -58,7 +58,7 @@ #include <qthreadpool.h> #include <qthreadstorage.h> #include <private/qthread_p.h> -#include <qtimestamp.h> +#include <qelapsedtimer.h> #include <qlibraryinfo.h> #include <qvarlengtharray.h> #include <private/qfactoryloader_p.h> @@ -917,7 +917,7 @@ void QCoreApplication::processEvents(QEventLoop::ProcessEventsFlags flags, int m QThreadData *data = QThreadData::current(); if (!data->eventDispatcher) return; - QTimestamp start; + QElapsedTimer start; start.start(); if (flags & QEventLoop::DeferredDeletion) QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp index 7a671d1..f7d45ac 100644 --- a/src/corelib/kernel/qeventdispatcher_unix.cpp +++ b/src/corelib/kernel/qeventdispatcher_unix.cpp @@ -45,7 +45,7 @@ #include "qpair.h" #include "qsocketnotifier.h" #include "qthread.h" -#include "qtimestamp.h" +#include "qelapsedtimer.h" #include "qeventdispatcher_unix_p.h" #include <private/qthread_p.h> @@ -313,7 +313,7 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags, QTimerInfoList::QTimerInfoList() { #if (_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_MAC) - if (!QTimestamp::isMonotonic()) { + if (!QElapsedTimer::isMonotonic()) { // not using monotonic timers, initialize the timeChanged() machinery previousTime = qt_gettime(); @@ -392,7 +392,7 @@ bool QTimerInfoList::timeChanged(timeval *delta) void QTimerInfoList::repairTimersIfNeeded() { - if (QTimestamp::isMonotonic()) + if (QElapsedTimer::isMonotonic()) return; timeval delta; if (timeChanged(&delta)) diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h index 75b5985..cb7f5bd 100644 --- a/src/corelib/tools/qdatetime.h +++ b/src/corelib/tools/qdatetime.h @@ -204,7 +204,7 @@ private: friend class QDateTime; friend class QDateTimePrivate; - friend class QTimestamp; + friend class QElapsedTimer; #ifndef QT_NO_DATASTREAM friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QTime &); friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QTime &); diff --git a/src/corelib/tools/qtimeline.cpp b/src/corelib/tools/qtimeline.cpp index 57977bc..f413223 100644 --- a/src/corelib/tools/qtimeline.cpp +++ b/src/corelib/tools/qtimeline.cpp @@ -44,7 +44,7 @@ #include <private/qobject_p.h> #include <QtCore/qcoreevent.h> #include <QtCore/qmath.h> -#include <QtCore/qtimestamp.h> +#include <QtCore/qelapsedtimer.h> QT_BEGIN_NAMESPACE @@ -70,7 +70,7 @@ public: int currentTime; int timerId; - QTimestamp timer; + QElapsedTimer timer; QTimeLine::Direction direction; QEasingCurve easingCurve; diff --git a/src/corelib/tools/qtimestamp.cpp b/src/corelib/tools/qtimestamp.cpp index b861099..220b108 100644 --- a/src/corelib/tools/qtimestamp.cpp +++ b/src/corelib/tools/qtimestamp.cpp @@ -39,23 +39,23 @@ ** ****************************************************************************/ -#include "qtimestamp.h" +#include "qelapsedtimer.h" QT_BEGIN_NAMESPACE static const qint64 invalidData = Q_INT64_C(0x8000000000000000); -void QTimestamp::invalidate() +void QElapsedTimer::invalidate() { t1 = t2 = invalidData; } -bool QTimestamp::isValid() const +bool QElapsedTimer::isValid() const { return t1 != invalidData && t2 != invalidData; } -bool QTimestamp::hasExpired(qint64 timeout) const +bool QElapsedTimer::hasExpired(qint64 timeout) const { // if timeout is -1, quint64(timeout) is LLINT_MAX, so this will be // considered as never expired diff --git a/src/corelib/tools/qtimestamp.h b/src/corelib/tools/qtimestamp.h index de87ad8..4fa0ca5 100644 --- a/src/corelib/tools/qtimestamp.h +++ b/src/corelib/tools/qtimestamp.h @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Core) -class Q_CORE_EXPORT QTimestamp +class Q_CORE_EXPORT QElapsedTimer { public: static bool isMonotonic(); @@ -63,15 +63,15 @@ public: qint64 elapsed() const; bool hasExpired(qint64 timeout) const; - qint64 msecsTo(const QTimestamp &other) const; - qint64 secsTo(const QTimestamp &other) const; + qint64 msecsTo(const QElapsedTimer &other) const; + qint64 secsTo(const QElapsedTimer &other) const; - bool operator==(const QTimestamp &other) const + bool operator==(const QElapsedTimer &other) const { return t1 == other.t1 && t2 == other.t2; } - bool operator!=(const QTimestamp &other) const + bool operator!=(const QElapsedTimer &other) const { return !(*this == other); } - friend bool Q_CORE_EXPORT operator<(const QTimestamp &v1, const QTimestamp &v2); + friend bool Q_CORE_EXPORT operator<(const QElapsedTimer &v1, const QElapsedTimer &v2); private: qint64 t1; diff --git a/src/corelib/tools/qtimestamp_generic.cpp b/src/corelib/tools/qtimestamp_generic.cpp index c80ac34..a9c2233 100644 --- a/src/corelib/tools/qtimestamp_generic.cpp +++ b/src/corelib/tools/qtimestamp_generic.cpp @@ -39,24 +39,24 @@ ** ****************************************************************************/ -#include "qtimestamp.h" +#include "qelapsedtimer.h" #include "qdatetime.h" QT_BEGIN_NAMESPACE -bool QTimestamp::isMonotonic() +bool QElapsedTimer::isMonotonic() { return false; } -void QTimestamp::start() +void QElapsedTimer::start() { QTime t = QTime::currentTime(); t1 = t.mds; t2 = 0; } -qint64 QTimestamp::restart() +qint64 QElapsedTimer::restart() { QTime t = QTime::currentTime(); qint64 old = t1; @@ -64,13 +64,13 @@ qint64 QTimestamp::restart() return t1 - old; } -qint64 QTimestamp::elapsed() const +qint64 QElapsedTimer::elapsed() const { QTime t = QTime::currentTime(); return t.mds - t1; } -qint64 QTimestamp::msecsTo(const QTimestamp &other) const +qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const { qint64 diff = other.t1 - t1; if (diff < 0) // passed midnight @@ -78,12 +78,12 @@ qint64 QTimestamp::msecsTo(const QTimestamp &other) const return diff; } -qint64 QTimestamp::secsTo(const QTimestamp &other) const +qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const { return msecsTo(other) / 1000; } -bool operator<(const QTimestamp &v1, const QTimestamp &v2) +bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) { return v1.t1 < v2.t1; } diff --git a/src/corelib/tools/qtimestamp_mac.cpp b/src/corelib/tools/qtimestamp_mac.cpp index 02f0fa7..21a6d1b 100644 --- a/src/corelib/tools/qtimestamp_mac.cpp +++ b/src/corelib/tools/qtimestamp_mac.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qtimestamp.h" +#include "qelapsedtimer.h" #include <sys/time.h> #include <unistd.h> @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE -bool QTimestamp::isMonotonic() +bool QElapsedTimer::isMonotonic() { return true; } @@ -77,13 +77,13 @@ timeval qt_gettime() return tv; } -void QTimestamp::start() +void QElapsedTimer::start() { t1 = mach_absolute_time(); t2 = 0; } -qint64 QTimestamp::restart() +qint64 QElapsedTimer::restart() { qint64 old = t1; t1 = mach_absolute_time(); @@ -91,23 +91,23 @@ qint64 QTimestamp::restart() return absoluteToMSecs(t1 - old); } -qint64 QTimestamp::elapsed() const +qint64 QElapsedTimer::elapsed() const { uint64_t cpu_time = mach_absolute_time(); return absoluteToMSecs(cpu_time - t1); } -qint64 QTimestamp::msecsTo(const QTimestamp &other) const +qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const { return absoluteToMSecs(other.t1 - t1); } -qint64 QTimestamp::secsTo(const QTimestamp &other) const +qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const { return msecsTo(other) / 1000; } -bool operator<(const QTimestamp &v1, const QTimestamp &v2) +bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) { return v1.t1 < v2.t1; } diff --git a/src/corelib/tools/qtimestamp_symbian.cpp b/src/corelib/tools/qtimestamp_symbian.cpp index 1d7b6ff..1fbba65 100644 --- a/src/corelib/tools/qtimestamp_symbian.cpp +++ b/src/corelib/tools/qtimestamp_symbian.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qtimestamp.h" +#include "qelapsedtimer.h" #include <e32std.h> QT_BEGIN_NAMESPACE @@ -65,40 +65,40 @@ static qint64 difference(qint64 a, qint64 b) return retval; } -bool QTimestamp::isMonotonic() +bool QElapsedTimer::isMonotonic() { return true; } -void QTimestamp::start() +void QElapsedTimer::start() { t1 = getMillisecondFromTick(); t2 = 0; } -qint64 QTimestamp::restart() +qint64 QElapsedTimer::restart() { qint64 oldt1 = t1; t1 = getMillisecondFromTick(); return difference(t1, oldt1); } -qint64 QTimestamp::elapsed() const +qint64 QElapsedTimer::elapsed() const { return difference(getMillisecondFromTick(), t1); } -qint64 QTimestamp::msecsTo(const QTimestamp &other) const +qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const { return difference(other.t1, t1); } -qint64 QTimestamp::secsTo(const QTimestamp &other) const +qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const { return msecsTo(other) / 1000; } -bool operator<(const QTimestamp &v1, const QTimestamp &v2) +bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) { return difference(v1.t1, v2.t1) < 0; } diff --git a/src/corelib/tools/qtimestamp_unix.cpp b/src/corelib/tools/qtimestamp_unix.cpp index 507c861..b8215f4 100644 --- a/src/corelib/tools/qtimestamp_unix.cpp +++ b/src/corelib/tools/qtimestamp_unix.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qtimestamp.h" +#include "qelapsedtimer.h" #include "qpair.h" #include <sys/time.h> #include <time.h> @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE static qint64 fractionAdjustment() { - if (QTimestamp::isMonotonic()) { + if (QElapsedTimer::isMonotonic()) { // the monotonic timer is measured in nanoseconds // 1 ms = 1000000 ns return 1000*1000ull; @@ -66,7 +66,7 @@ static qint64 fractionAdjustment() } } -bool QTimestamp::isMonotonic() +bool QElapsedTimer::isMonotonic() { #if (_POSIX_MONOTONIC_CLOCK-0 > 0) return true; @@ -95,7 +95,7 @@ static inline QPair<long, long> do_gettime() return qMakePair(ts.tv_sec, ts.tv_nsec); #else # if !defined(QT_NO_CLOCK_MONOTONIC) && !defined(QT_BOOTSTRAPPED) - if (QTimestamp::isMonotonic()) { + if (QElapsedTimer::isMonotonic()) { timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); return qMakePair(ts.tv_sec, ts.tv_nsec); @@ -116,20 +116,20 @@ timeval qt_gettime() timeval tv; tv.tv_sec = r.first; tv.tv_usec = r.second; - if (QTimestamp::isMonotonic()) + if (QElapsedTimer::isMonotonic()) tv.tv_usec /= 1000; return tv; } -void QTimestamp::start() +void QElapsedTimer::start() { QPair<long, long> r = do_gettime(); t1 = r.first; t2 = r.second; } -qint64 QTimestamp::restart() +qint64 QElapsedTimer::restart() { QPair<long, long> r = do_gettime(); qint64 oldt1 = t1; @@ -142,26 +142,26 @@ qint64 QTimestamp::restart() return r.first * 1000 + r.second / fractionAdjustment(); } -qint64 QTimestamp::elapsed() const +qint64 QElapsedTimer::elapsed() const { - QTimestamp now; + QElapsedTimer now; now.start(); return msecsTo(now); } -qint64 QTimestamp::msecsTo(const QTimestamp &other) const +qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const { qint64 secs = other.t1 - t1; qint64 fraction = other.t2 - t2; return secs * 1000 + fraction / fractionAdjustment(); } -qint64 QTimestamp::secsTo(const QTimestamp &other) const +qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const { return other.t1 - t1; } -bool operator<(const QTimestamp &v1, const QTimestamp &v2) +bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) { return v1.t1 < v2.t1 || (v1.t1 == v2.t1 && v1.t2 < v2.t2); } diff --git a/src/corelib/tools/qtimestamp_win.cpp b/src/corelib/tools/qtimestamp_win.cpp index 1aea5cf..e384dd8 100644 --- a/src/corelib/tools/qtimestamp_win.cpp +++ b/src/corelib/tools/qtimestamp_win.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qtimestamp.h" +#include "qelapsedtimer.h" #include <windows.h> typedef ULONGLONG (WINAPI *PtrGetTickCount64)(void); @@ -88,40 +88,40 @@ static qint64 difference(qint64 a, qint64 b) return retval; } -bool QTimestamp::isMonotonic() +bool QElapsedTimer::isMonotonic() { return true; } -void QTimestamp::start() +void QElapsedTimer::start() { t1 = getTickCount(); t2 = 0; } -qint64 QTimestamp::restart() +qint64 QElapsedTimer::restart() { qint64 oldt1 = t1; t1 = getTickCount(); return difference(t1, oldt1); } -qint64 QTimestamp::elapsed() const +qint64 QElapsedTimer::elapsed() const { return difference(getTickCount(), t1); } -qint64 QTimestamp::msecsTo(const QTimestamp &other) const +qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const { return difference(other.t1, t1); } -qint64 QTimestamp::secsTo(const QTimestamp &other) const +qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const { return msecsTo(other) / 1000; } -bool operator<(const QTimestamp &v1, const QTimestamp &v2) +bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) { return difference(v1.t1, v2.t1) < 0; } diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri index e1097c4..692fae9 100644 --- a/src/corelib/tools/tools.pri +++ b/src/corelib/tools/tools.pri @@ -42,7 +42,7 @@ HEADERS += \ tools/qstringmatcher.h \ tools/qtextboundaryfinder.h \ tools/qtimeline.h \ - tools/qtimestamp.h \ + tools/qelapsedtimer.h \ tools/qunicodetables_p.h \ tools/qvarlengtharray.h \ tools/qvector.h \ @@ -77,16 +77,16 @@ SOURCES += \ tools/qstringlist.cpp \ tools/qtextboundaryfinder.cpp \ tools/qtimeline.cpp \ - tools/qtimestamp.cpp \ + tools/qelapsedtimer.cpp \ tools/qvector.cpp \ tools/qvsnprintf.cpp symbian:SOURCES+=tools/qlocale_symbian.cpp -mac:SOURCES += tools/qtimestamp_mac.cpp -else:unix:SOURCES += tools/qtimestamp_unix.cpp -else:win32:SOURCES += tools/qtimestamp_win.cpp -else:SOURCES += tools/qtimestamp_generic.cpp +mac:SOURCES += tools/qelapsedtimer_mac.cpp +else:unix:SOURCES += tools/qelapsedtimer_unix.cpp +else:win32:SOURCES += tools/qelapsedtimer_win.cpp +else:SOURCES += tools/qelapsedtimer_generic.cpp #zlib support contains(QT_CONFIG, zlib) { diff --git a/src/gui/dialogs/qfileinfogatherer.cpp b/src/gui/dialogs/qfileinfogatherer.cpp index a565c45..3b279ae 100644 --- a/src/gui/dialogs/qfileinfogatherer.cpp +++ b/src/gui/dialogs/qfileinfogatherer.cpp @@ -297,7 +297,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil return; } - QTimestamp base; + QElapsedTimer base; base.start(); QFileInfo fileInfo; bool firstTime = true; @@ -327,9 +327,9 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil emit directoryLoaded(path); } -void QFileInfoGatherer::fetch(const QFileInfo &fileInfo, QTimestamp &base, bool &firstTime, QList<QPair<QString, QFileInfo> > &updatedFiles, const QString &path) { +void QFileInfoGatherer::fetch(const QFileInfo &fileInfo, QElapsedTimer &base, bool &firstTime, QList<QPair<QString, QFileInfo> > &updatedFiles, const QString &path) { updatedFiles.append(QPair<QString, QFileInfo>(fileInfo.fileName(), fileInfo)); - QTimestamp current; + QElapsedTimer current; current.start(); if ((firstTime && updatedFiles.count() > 100) || base.msecsTo(current) > 1000) { emit updates(path, updatedFiles); diff --git a/src/gui/dialogs/qfileinfogatherer_p.h b/src/gui/dialogs/qfileinfogatherer_p.h index a2b9acd..5abcd94 100644 --- a/src/gui/dialogs/qfileinfogatherer_p.h +++ b/src/gui/dialogs/qfileinfogatherer_p.h @@ -63,7 +63,7 @@ #include <qstack.h> #include <qdatetime.h> #include <qdir.h> -#include <qtimestamp.h> +#include <qelapsedtimer.h> QT_BEGIN_NAMESPACE @@ -175,7 +175,7 @@ protected: void getFileInfos(const QString &path, const QStringList &files); private: - void fetch(const QFileInfo &info, QTimestamp &base, bool &firstTime, QList<QPair<QString, QFileInfo> > &updatedFiles, const QString &path); + void fetch(const QFileInfo &info, QElapsedTimer &base, bool &firstTime, QList<QPair<QString, QFileInfo> > &updatedFiles, const QString &path); QString translateDriveName(const QFileInfo &drive) const; QMutex mutex; diff --git a/src/gui/dialogs/qprogressdialog.cpp b/src/gui/dialogs/qprogressdialog.cpp index 602f47c..a2d7b23 100644 --- a/src/gui/dialogs/qprogressdialog.cpp +++ b/src/gui/dialogs/qprogressdialog.cpp @@ -53,7 +53,7 @@ #include "qpushbutton.h" #include "qcursor.h" #include "qtimer.h" -#include "qtimestamp.h" +#include "qelapsedtimer.h" #include <private/qdialog_p.h> #include <limits.h> @@ -103,7 +103,7 @@ public: QTimer *forceTimer; bool shown_once; bool cancellation_flag; - QTimestamp starttime; + QElapsedTimer starttime; #ifndef QT_NO_CURSOR QCursor parentCursor; #endif diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 34b5e13..3738816 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -2839,7 +2839,7 @@ void QAbstractItemView::keyboardSearch(const QString &search) QModelIndex start = currentIndex().isValid() ? currentIndex() : d->model->index(0, 0, d->root); - QTimestamp now; + QElapsedTimer now; now.start(); bool skipRow = false; if (search.isEmpty() diff --git a/src/gui/itemviews/qabstractitemview_p.h b/src/gui/itemviews/qabstractitemview_p.h index 4af98b4..509459c 100644 --- a/src/gui/itemviews/qabstractitemview_p.h +++ b/src/gui/itemviews/qabstractitemview_p.h @@ -64,7 +64,7 @@ #include "QtCore/qdebug.h" #include "QtGui/qpainter.h" #include "QtCore/qbasictimer.h" -#include "QtCore/qtimestamp.h" +#include "QtCore/qelapsedtimer.h" #ifndef QT_NO_ITEMVIEWS @@ -390,7 +390,7 @@ public: #endif QString keyboardInput; - QTimestamp keyboardInputTime; + QElapsedTimer keyboardInputTime; bool autoScroll; QBasicTimer autoScrollTimer; diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp index 9f8c322..fcdc429 100644 --- a/src/gui/itemviews/qtreeview.cpp +++ b/src/gui/itemviews/qtreeview.cpp @@ -958,7 +958,7 @@ void QTreeView::keyboardSearch(const QString &search) else start = d->model->index(0, 0, d->root); - QTimestamp now; + QElapsedTimer now; now.start(); bool skipRow = false; if (search.isEmpty() diff --git a/src/gui/kernel/qclipboard_x11.cpp b/src/gui/kernel/qclipboard_x11.cpp index 2a9706b..3bdc971 100644 --- a/src/gui/kernel/qclipboard_x11.cpp +++ b/src/gui/kernel/qclipboard_x11.cpp @@ -75,7 +75,7 @@ #include "qt_x11_p.h" #include "qx11info_x11.h" #include "qimagewriter.h" -#include "qtimestamp.h" +#include "qelapsedtimer.h" #include "qvariant.h" #include "qdnd_p.h" #include <private/qwidget_p.h> @@ -516,9 +516,9 @@ static Bool checkForClipboardEvents(Display *, XEvent *e, XPointer) bool QX11Data::clipboardWaitForEvent(Window win, int type, XEvent *event, int timeout) { - QTimestamp started; + QElapsedTimer started; started.start(); - QTimestamp now = started; + QElapsedTimer now = started; if (QAbstractEventDispatcher::instance()->inherits("QtMotif") || QApplication::clipboard()->property("useEventLoopWhenWaiting").toBool()) { diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp index 0d24ed7..0a05d8e 100644 --- a/src/gui/kernel/qdnd_x11.cpp +++ b/src/gui/kernel/qdnd_x11.cpp @@ -54,7 +54,7 @@ #include "qiodevice.h" #include "qpointer.h" #include "qcursor.h" -#include "qtimestamp.h" +#include "qelapsedtimer.h" #include "qvariant.h" #include "qvector.h" #include "qurl.h" @@ -1911,7 +1911,7 @@ Qt::DropAction QDragManager::drag(QDrag * o) // then we could still have problems, but this is highly unlikely QApplication::flush(); - QTimestamp timer; + QElapsedTimer timer; timer.start(); do { XEvent event; diff --git a/src/gui/kernel/qgesture_p.h b/src/gui/kernel/qgesture_p.h index 84d8b7c..bf60f97 100644 --- a/src/gui/kernel/qgesture_p.h +++ b/src/gui/kernel/qgesture_p.h @@ -56,7 +56,7 @@ #include "qrect.h" #include "qpoint.h" #include "qgesture.h" -#include "qtimestamp.h" +#include "qelapsedtimer.h" #include "private/qobject_p.h" QT_BEGIN_NAMESPACE @@ -148,7 +148,7 @@ public: QPoint lastPositions[3]; bool started; qreal speed; - QTimestamp time; + QElapsedTimer time; }; class QTapGesturePrivate : public QGesturePrivate diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp index 3fbb9ce..b4febc6 100644 --- a/src/gui/kernel/qwidget_x11.cpp +++ b/src/gui/kernel/qwidget_x11.cpp @@ -49,7 +49,7 @@ #include "qbitmap.h" #include "qlayout.h" #include "qtextcodec.h" -#include "qtimestamp.h" +#include "qelapsedtimer.h" #include "qcursor.h" #include "qstack.h" #include "qcolormap.h" @@ -352,7 +352,7 @@ Q_GUI_EXPORT void qt_x11_wait_for_window_manager(QWidget* w) return; QApplication::flush(); XEvent ev; - QTimestamp t; + QElapsedTimer t; t.start(); static const int maximumWaitTime = 2000; if (!w->testAttribute(Qt::WA_WState_Created)) diff --git a/src/gui/kernel/qx11embed_x11.cpp b/src/gui/kernel/qx11embed_x11.cpp index b92a5b1..b527e72 100644 --- a/src/gui/kernel/qx11embed_x11.cpp +++ b/src/gui/kernel/qx11embed_x11.cpp @@ -47,7 +47,7 @@ #include <qlayout.h> #include <qstyle.h> #include <qstyleoption.h> -#include <qtimestamp.h> +#include <qelapsedtimer.h> #include <qpointer.h> #include <qdebug.h> #include <qx11info_x11.h> @@ -1231,7 +1231,7 @@ void QX11EmbedContainer::embedClient(WId id) For safety, we will not wait more than 500 ms, so that we can preemptively workaround buggy window managers. */ - QTimestamp t; + QElapsedTimer t; t.start(); functorData data; diff --git a/src/gui/styles/qplastiquestyle.cpp b/src/gui/styles/qplastiquestyle.cpp index 9f4d48e..4ae9f79 100644 --- a/src/gui/styles/qplastiquestyle.cpp +++ b/src/gui/styles/qplastiquestyle.cpp @@ -80,7 +80,7 @@ static const int blueFrameWidth = 2; // with of line edit focus frame #include <qsplitter.h> #include <qstyleoption.h> #include <qtextedit.h> -#include <qtimestamp.h> +#include <qelapsedtimer.h> #include <qtoolbar.h> #include <qtoolbox.h> #include <qtoolbutton.h> @@ -980,7 +980,7 @@ public: #ifndef QT_NO_PROGRESSBAR QList<QProgressBar *> bars; int progressBarAnimateTimer; - QTimestamp timer; + QElapsedTimer timer; #endif }; diff --git a/src/gui/styles/qwindowsstyle_p.h b/src/gui/styles/qwindowsstyle_p.h index 92060d8..2a89b84 100644 --- a/src/gui/styles/qwindowsstyle_p.h +++ b/src/gui/styles/qwindowsstyle_p.h @@ -59,7 +59,7 @@ #ifndef QT_NO_STYLE_WINDOWS #include <qlist.h> #include <qhash.h> -#include <qtimestamp.h> +#include <qelapsedtimer.h> QT_BEGIN_NAMESPACE @@ -80,7 +80,7 @@ public: QList<QProgressBar *> bars; int animationFps; int animateTimer; - QTimestamp startTime; + QElapsedTimer startTime; int animateStep; QColor inactiveCaptionText; QColor activeCaptionColor; diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp index fd3cba8..b1ab478 100644 --- a/src/gui/text/qfontdatabase_x11.cpp +++ b/src/gui/text/qfontdatabase_x11.cpp @@ -43,7 +43,7 @@ #include <qdebug.h> #include <qpaintdevice.h> -#include <qtimestamp.h> +#include <qelapsedtimer.h> #include <private/qt_x11_p.h> #include "qx11info_x11.h" @@ -1218,7 +1218,7 @@ static void load(const QString &family = QString(), int script = -1, bool forceX } #ifdef QFONTDATABASE_DEBUG - QTimestamp t; + QElapsedTimer t; t.start(); #endif @@ -1301,7 +1301,7 @@ static void initializeDb() if (!db || db->count) return; - QTimestamp t; + QElapsedTimer t; t.start(); #ifndef QT_NO_FONTCONFIG diff --git a/src/gui/widgets/qabstractslider_p.h b/src/gui/widgets/qabstractslider_p.h index c8c29b5..19d1fca 100644 --- a/src/gui/widgets/qabstractslider_p.h +++ b/src/gui/widgets/qabstractslider_p.h @@ -54,7 +54,7 @@ // #include "QtCore/qbasictimer.h" -#include "QtCore/qtimestamp.h" +#include "QtCore/qelapsedtimer.h" #include "private/qwidget_p.h" #include "qstyle.h" @@ -104,7 +104,7 @@ public: /** * The time of when the first auto repeating key press event occurs. */ - QTimestamp firstRepeat; + QElapsedTimer firstRepeat; #endif diff --git a/src/gui/widgets/qeffects.cpp b/src/gui/widgets/qeffects.cpp index 9dd853f..a56d093 100644 --- a/src/gui/widgets/qeffects.cpp +++ b/src/gui/widgets/qeffects.cpp @@ -49,7 +49,7 @@ #include "qpixmap.h" #include "qpointer.h" #include "qtimer.h" -#include "qtimestamp.h" +#include "qelapsedtimer.h" #include "qdebug.h" QT_BEGIN_NAMESPACE @@ -103,7 +103,7 @@ private: int elapsed; bool showWidget; QTimer anim; - QTimestamp checkTime; + QElapsedTimer checkTime; double windowOpacity; }; @@ -384,7 +384,7 @@ private: int orientation; QTimer anim; - QTimestamp checkTime; + QElapsedTimer checkTime; QPixmap pm; }; diff --git a/src/gui/widgets/qscrollbar.cpp b/src/gui/widgets/qscrollbar.cpp index 894300d..4ee9f27 100644 --- a/src/gui/widgets/qscrollbar.cpp +++ b/src/gui/widgets/qscrollbar.cpp @@ -47,7 +47,7 @@ #include "qstyle.h" #include "qstyleoption.h" #include "qmenu.h" -#include <QtCore/qtimestamp.h> +#include <QtCore/qelapsedtimer.h> #ifndef QT_NO_SCROLLBAR @@ -613,7 +613,7 @@ void QScrollBar::mousePressEvent(QMouseEvent *e) } const int initialDelay = 500; // default threshold d->activateControl(d->pressedControl, initialDelay); - QTimestamp time; + QElapsedTimer time; time.start(); repaint(style()->subControlRect(QStyle::CC_ScrollBar, &opt, d->pressedControl, this)); if (time.elapsed() >= initialDelay && d->repeatActionTimer.isActive()) { diff --git a/src/gui/widgets/qworkspace.cpp b/src/gui/widgets/qworkspace.cpp index b4e4cc4..7180c4d 100644 --- a/src/gui/widgets/qworkspace.cpp +++ b/src/gui/widgets/qworkspace.cpp @@ -58,7 +58,7 @@ #include "qscrollbar.h" #include "qstyle.h" #include "qstyleoption.h" -#include "qtimestamp.h" +#include "qelapsedtimer.h" #include "qtooltip.h" #include "qdebug.h" #include <private/qwidget_p.h> @@ -450,10 +450,10 @@ void QWorkspaceTitleBar::mousePressEvent(QMouseEvent *e) case QStyle::SC_TitleBarSysMenu: if (d->flags & Qt::WindowSystemMenuHint) { d->buttonDown = QStyle::SC_None; - static QTimestamp *t = 0; + static QElapsedTimer *t = 0; static QWorkspaceTitleBar *tc = 0; if (!t) - t = new QTimestamp; + t = new QElapsedTimer; if (tc != this || t->elapsed() > QApplication::doubleClickInterval()) { emit showOperationMenu(); t->start(); @@ -1839,7 +1839,7 @@ bool QWorkspace::event(QEvent *e) bool QWorkspace::eventFilter(QObject *o, QEvent * e) { Q_D(QWorkspace); - static QTimestamp* t = 0; + static QElapsedTimer* t = 0; static QWorkspace* tc = 0; if (o == d->maxtools) { switch (e->type()) { @@ -1847,7 +1847,7 @@ bool QWorkspace::eventFilter(QObject *o, QEvent * e) { QMenuBar* b = (QMenuBar*)o->parent(); if (!t) - t = new QTimestamp; + t = new QElapsedTimer; if (tc != this || t->elapsed() > QApplication::doubleClickInterval()) { if (isRightToLeft()) { QPoint p = b->mapToGlobal(QPoint(b->x() + b->width(), b->y() + b->height())); diff --git a/src/multimedia/audio/qaudioinput_alsa_p.h b/src/multimedia/audio/qaudioinput_alsa_p.h index 9a87691..c907019 100644 --- a/src/multimedia/audio/qaudioinput_alsa_p.h +++ b/src/multimedia/audio/qaudioinput_alsa_p.h @@ -61,7 +61,7 @@ #include <QtCore/qtimer.h> #include <QtCore/qstring.h> #include <QtCore/qstringlist.h> -#include <QtCore/qtimestamp.h> +#include <QtCore/qelapsedtimer.h> #include <QtCore/qdatetime.h> #include <QtMultimedia/qaudio.h> @@ -117,8 +117,8 @@ private: void drain(); QTimer* timer; - QTimestamp timeStamp; - QTimestamp clockStamp; + QElapsedTimer timeStamp; + QElapsedTimer clockStamp; qint64 elapsedTimeOffset; int intervalTime; char* audioBuffer; diff --git a/src/multimedia/audio/qaudiooutput_alsa_p.h b/src/multimedia/audio/qaudiooutput_alsa_p.h index c655701..e6ac231 100644 --- a/src/multimedia/audio/qaudiooutput_alsa_p.h +++ b/src/multimedia/audio/qaudiooutput_alsa_p.h @@ -60,7 +60,7 @@ #include <QtCore/qtimer.h> #include <QtCore/qstring.h> #include <QtCore/qstringlist.h> -#include <QtCore/qtimestamp.h> +#include <QtCore/qelapsedtimer.h> #include <QtCore/qdatetime.h> #include <QtMultimedia/qaudio.h> @@ -134,8 +134,8 @@ private: QTimer* timer; QByteArray m_device; int bytesAvailable; - QTimestamp timeStamp; - QTimestamp clockStamp; + QElapsedTimer timeStamp; + QElapsedTimer clockStamp; qint64 elapsedTimeOffset; char* audioBuffer; snd_pcm_t* handle; diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index fc50ee5..21cd0fd 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -370,7 +370,7 @@ #include <qmetaobject.h> #include <qpointer.h> #include <qtimer.h> -#include <qtimestamp.h> +#include <qelapsedtimer.h> #ifndef QT_NO_OPENSSL #include <QtNetwork/qsslsocket.h> @@ -1738,7 +1738,7 @@ bool QAbstractSocket::waitForConnected(int msecs) bool wasPendingClose = d->pendingClose; d->pendingClose = false; - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); if (d->state == HostLookupState) { @@ -1819,7 +1819,7 @@ bool QAbstractSocket::waitForReadyRead(int msecs) return false; } - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); // handle a socket in connecting state @@ -1878,7 +1878,7 @@ bool QAbstractSocket::waitForBytesWritten(int msecs) if (d->writeBuffer.isEmpty()) return false; - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); // handle a socket in connecting state @@ -1960,7 +1960,7 @@ bool QAbstractSocket::waitForDisconnected(int msecs) return false; } - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); // handle a socket in connecting state diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp index 9d412ac..dfda257 100644 --- a/src/network/socket/qhttpsocketengine.cpp +++ b/src/network/socket/qhttpsocketengine.cpp @@ -44,7 +44,7 @@ #include "qhostaddress.h" #include "qurl.h" #include "qhttp.h" -#include "qtimestamp.h" +#include "qelapsedtimer.h" #if !defined(QT_NO_NETWORKPROXY) && !defined(QT_NO_HTTP) #include <qdebug.h> @@ -319,7 +319,7 @@ bool QHttpSocketEngine::waitForRead(int msecs, bool *timedOut) if (!d->socket || d->socket->state() == QAbstractSocket::UnconnectedState) return false; - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); // Wait for more data if nothing is available. @@ -366,7 +366,7 @@ bool QHttpSocketEngine::waitForWrite(int msecs, bool *timedOut) return true; } - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); // If we're not connected yet, wait until we are, and until bytes have diff --git a/src/network/socket/qlocalsocket_unix.cpp b/src/network/socket/qlocalsocket_unix.cpp index 20301ba..f14decc 100644 --- a/src/network/socket/qlocalsocket_unix.cpp +++ b/src/network/socket/qlocalsocket_unix.cpp @@ -54,7 +54,7 @@ #include <qdir.h> #include <qdebug.h> -#include <qtimestamp.h> +#include <qelapsedtimer.h> #ifdef Q_OS_VXWORKS # include <selectLib.h> @@ -534,7 +534,7 @@ bool QLocalSocket::waitForConnected(int msec) int result = -1; // on Linux timeout will be updated by select, but _not_ on other systems. - QTimestamp timer; + QElapsedTimer timer; timer.start(); while (state() == ConnectingState && (-1 == msec || timer.elapsed() < msec)) { diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp index 7c1fc17..6c800fe 100644 --- a/src/network/socket/qnativesocketengine_unix.cpp +++ b/src/network/socket/qnativesocketengine_unix.cpp @@ -44,7 +44,7 @@ #include "private/qnet_unix_p.h" #include "qiodevice.h" #include "qhostaddress.h" -#include "qtimestamp.h" +#include "qelapsedtimer.h" #include "qvarlengtharray.h" #include <time.h> #include <errno.h> @@ -1003,7 +1003,7 @@ int QNativeSocketEnginePrivate::nativeSelect(int timeout, bool checkRead, bool c #ifndef Q_OS_SYMBIAN ret = qt_safe_select(socketDescriptor + 1, &fdread, &fdwrite, 0, timeout < 0 ? 0 : &tv); #else - QTimestamp timer; + QElapsedTimer timer; timer.start(); do { diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp index 0c6a01a..f68edfe 100644 --- a/src/network/socket/qsocks5socketengine.cpp +++ b/src/network/socket/qsocks5socketengine.cpp @@ -49,7 +49,7 @@ #include "qdebug.h" #include "qhash.h" #include "qqueue.h" -#include "qtimestamp.h" +#include "qelapsedtimer.h" #include "qmutex.h" #include "qthread.h" #include "qcoreapplication.h" @@ -308,7 +308,7 @@ struct QSocks5BindData : public QSocks5Data quint16 localPort; QHostAddress peerAddress; quint16 peerPort; - QTimestamp timeStamp; + QElapsedTimer timeStamp; }; struct QSocks5RevivedDatagram @@ -1355,7 +1355,7 @@ bool QSocks5SocketEngine::bind(const QHostAddress &address, quint16 port) } int msecs = SOCKS5_BLOCKING_BIND_TIMEOUT; - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); d->data->controlSocket->connectToHost(d->proxyInfo.hostName(), d->proxyInfo.port()); if (!d->waitForConnected(msecs, 0) || @@ -1455,7 +1455,7 @@ void QSocks5SocketEngine::close() if (d->data && d->data->controlSocket) { if (d->data->controlSocket->state() == QAbstractSocket::ConnectedState) { int msecs = 100; - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); while (!d->data->controlSocket->bytesToWrite()) { if (!d->data->controlSocket->waitForBytesWritten(qt_timeout_value(msecs, stopWatch.elapsed()))) @@ -1674,7 +1674,7 @@ bool QSocks5SocketEnginePrivate::waitForConnected(int msecs, bool *timedOut) mode == BindMode ? BindSuccess : UdpAssociateSuccess; - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); while (socks5State != wantedState) { @@ -1699,7 +1699,7 @@ bool QSocks5SocketEngine::waitForRead(int msecs, bool *timedOut) d->readNotificationActivated = false; - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); // are we connected yet? @@ -1749,7 +1749,7 @@ bool QSocks5SocketEngine::waitForWrite(int msecs, bool *timedOut) Q_D(QSocks5SocketEngine); QSOCKS5_DEBUG << "waitForWrite" << msecs; - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); // are we connected yet? diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index 895e32c..86b11b9 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -287,7 +287,7 @@ #include <QtCore/qdebug.h> #include <QtCore/qdir.h> #include <QtCore/qmutex.h> -#include <QtCore/qtimestamp.h> +#include <QtCore/qelapsedtimer.h> #include <QtNetwork/qhostaddress.h> #include <QtNetwork/qhostinfo.h> @@ -1393,7 +1393,7 @@ bool QSslSocket::waitForEncrypted(int msecs) if (d->mode == UnencryptedMode && !d->autoStartHandshake) return false; - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); if (d->plainSocket->state() != QAbstractSocket::ConnectedState) { @@ -1433,7 +1433,7 @@ bool QSslSocket::waitForReadyRead(int msecs) bool *previousReadyReadEmittedPointer = d->readyReadEmittedPointer; d->readyReadEmittedPointer = &readyReadEmitted; - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); if (!d->connectionEncrypted) { @@ -1470,7 +1470,7 @@ bool QSslSocket::waitForBytesWritten(int msecs) if (d->mode == UnencryptedMode) return d->plainSocket->waitForBytesWritten(msecs); - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); if (!d->connectionEncrypted) { @@ -1508,7 +1508,7 @@ bool QSslSocket::waitForDisconnected(int msecs) if (d->mode == UnencryptedMode) return d->plainSocket->waitForDisconnected(msecs); - QTimestamp stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); if (!d->connectionEncrypted) { diff --git a/src/testlib/qtestsystem.h b/src/testlib/qtestsystem.h index 54da114..82d69d6 100644 --- a/src/testlib/qtestsystem.h +++ b/src/testlib/qtestsystem.h @@ -44,7 +44,7 @@ #include <QtTest/qtestcase.h> #include <QtCore/qcoreapplication.h> -#include <QtCore/qtimestamp.h> +#include <QtCore/qelapsedtimer.h> QT_BEGIN_HEADER @@ -63,7 +63,7 @@ namespace QTest { Q_ASSERT(QCoreApplication::instance()); - QTimestamp timer; + QElapsedTimer timer; timer.start(); do { QCoreApplication::processEvents(QEventLoop::AllEvents, ms); |