diff options
author | Konrad Kujawa <konrad.kujawa@qt.io> | 2022-08-25 15:39:22 +0200 |
---|---|---|
committer | Konrad Kujawa <konrad.kujawa@qt.io> | 2022-08-30 15:46:01 +0200 |
commit | da12a40b8b2c2d212412a9db6d7971dc43bce6e6 (patch) | |
tree | 2fea540cc52c6bc75b7a4d32d187791d0536d15d /src/corelib/kernel/qtimerinfo_unix.cpp | |
parent | 89a703dcb88911b9e4dba246024c314b04b1afe7 (diff) |
Migrate QBasicTimer from int to qint64
QBasicTimer::start() now accepts qint64 instead of int.
Change-Id: Iba3f394b6c20daf762f1add5a9eed22c8a67c802
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qtimerinfo_unix.cpp')
-rw-r--r-- | src/corelib/kernel/qtimerinfo_unix.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/corelib/kernel/qtimerinfo_unix.cpp b/src/corelib/kernel/qtimerinfo_unix.cpp index 48ce893988..288fb30d32 100644 --- a/src/corelib/kernel/qtimerinfo_unix.cpp +++ b/src/corelib/kernel/qtimerinfo_unix.cpp @@ -380,18 +380,17 @@ bool QTimerInfoList::timerWait(timespec &tm) } /* - Returns the timer's remaining time in milliseconds with the given timerId, or - null if there is nothing left. If the timer id is not found in the list, the - returned value will be -1. If the timer is overdue, the returned value will be 0. + Returns the timer's remaining time in milliseconds with the given timerId. + If the timer id is not found in the list, the returned value will be -1. + If the timer is overdue, the returned value will be 0. */ -int QTimerInfoList::timerRemainingTime(int timerId) +qint64 QTimerInfoList::timerRemainingTime(int timerId) { timespec currentTime = updateCurrentTime(); repairTimersIfNeeded(); timespec tm = {0, 0}; - for (int i = 0; i < count(); ++i) { - QTimerInfo *t = at(i); + for (const auto *t : *this) { if (t->id == timerId) { if (currentTime < t->timeout) { // time to wait |