Do not always compile in QTimerInfoList::repairTimers()

This function is never called on systems that are guaranteed to have
a monotonic click (like Mac OS X). Remove the dead code from the
library.

Change-Id: I95852c8dffaa3a9747367f0abe4a4c62e4f86421
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
Bradley T. Hughes 2012-01-05 13:45:36 +01:00 committed by Qt by Nokia
parent c46654b3a5
commit 7023bb1d35
2 changed files with 13 additions and 13 deletions

View File

@ -147,6 +147,18 @@ bool QTimerInfoList::timeChanged(timeval *delta)
return elapsedTimeTicks < ((qAbs(*delta) - tickGranularity) * 10);
}
/*
repair broken timer
*/
void QTimerInfoList::timerRepair(const timeval &diff)
{
// repair all timers
for (int i = 0; i < size(); ++i) {
register QTimerInfo *t = at(i);
t->timeout = t->timeout + diff;
}
}
void QTimerInfoList::repairTimersIfNeeded()
{
if (QElapsedTimer::isMonotonic())
@ -178,18 +190,6 @@ void QTimerInfoList::timerInsert(QTimerInfo *ti)
insert(index+1, ti);
}
/*
repair broken timer
*/
void QTimerInfoList::timerRepair(const timeval &diff)
{
// repair all timers
for (int i = 0; i < size(); ++i) {
register QTimerInfo *t = at(i);
t->timeout = t->timeout + diff;
}
}
inline timeval &operator+=(timeval &t1, int ms)
{
t1.tv_sec += ms / 1000;

View File

@ -86,6 +86,7 @@ class QTimerInfoList : public QList<QTimerInfo*>
int msPerTick;
bool timeChanged(timeval *delta);
void timerRepair(const timeval &);
#endif
// state variables used by activateTimers()
@ -102,7 +103,6 @@ public:
bool timerWait(timeval &);
void timerInsert(QTimerInfo *);
void timerRepair(const timeval &);
void registerTimer(int timerId, int interval, Qt::TimerType timerType, QObject *object);
bool unregisterTimer(int timerId);