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:
parent
c46654b3a5
commit
7023bb1d35
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user