summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-09-15 22:08:44 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-09-15 22:08:44 (GMT)
commit43f13b2deed1dc3797dec58b46957714ff635f66 (patch)
treecb588ed2ac1c9c00ae5129adc6f996f628514b9d /src/corelib
parentab31c1a482630007eccd532b49e03f0345421aa8 (diff)
parentf23bce37a8a3536bfedce7cc2d57f0761b2d1e31 (diff)
downloadQt-43f13b2deed1dc3797dec58b46957714ff635f66.zip
Qt-43f13b2deed1dc3797dec58b46957714ff635f66.tar.gz
Qt-43f13b2deed1dc3797dec58b46957714ff635f66.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Doc: Further QML improvements. Doc: Minor improvements to QML-related documentation. The test livelock of QTimer is now expected to work Make sure mapSelectionFromSource does not return a selection with invalid ranges. QEventDispatcherUnix: do not process too many timer if other events need to be processed first Doc: Continued work on the QML documentation. Doc: More work on the QML documentation. Doc: More work on the declarative API documentation. Doc: Some editing and tidying up. Doc: Added a missing file. Doc: Fixed text in license headers.
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp
index 9dadd82..f50994c 100644
--- a/src/corelib/kernel/qeventdispatcher_unix.cpp
+++ b/src/corelib/kernel/qeventdispatcher_unix.cpp
@@ -549,18 +549,22 @@ int QTimerInfoList::activateTimers()
if (qt_disable_lowpriority_timers || isEmpty())
return 0; // nothing to do
- bool firstTime = true;
- timeval currentTime;
- int n_act = 0, maxCount = count();
+ int n_act = 0, maxCount = 0;
firstTimerInfo = 0;
- while (maxCount--) {
- currentTime = updateCurrentTime();
- if (firstTime) {
- repairTimersIfNeeded();
- firstTime = false;
- }
+ timeval currentTime = updateCurrentTime();
+ repairTimersIfNeeded();
+
+ // Find out how many timer have expired
+ for (QTimerInfoList::const_iterator it = constBegin(); it != constEnd(); ++it) {
+ if (currentTime < (*it)->timeout)
+ break;
+ maxCount++;
+ }
+
+ //fire the timers.
+ while (maxCount--) {
if (isEmpty())
break;