summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-05-12 09:39:16 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-05-18 13:17:09 (GMT)
commitce851964f45266cafd51f2c1ac4e9a7d89ce0ef0 (patch)
tree81c2373e8f9e1e21eff8d17f6844cdf17a7bd0f8 /src/gui
parent5c42e4328cc2bea53dc4d31eb3f4d10d42ac6ee1 (diff)
downloadQt-ce851964f45266cafd51f2c1ac4e9a7d89ce0ef0.zip
Qt-ce851964f45266cafd51f2c1ac4e9a7d89ce0ef0.tar.gz
Qt-ce851964f45266cafd51f2c1ac4e9a7d89ce0ef0.tar.bz2
Replaced evil foreach with a for loop.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qgesturemanager.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index c7341f2..1dda34c 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -248,11 +248,15 @@ bool QGestureManager::filterEvent(QWidget *receiver, QEvent *event)
activeGestures -= newMaybeGestures;
activeGestures -= cancelledGestures;
activeGestures += startedGestures;
- foreach(QGestureRecognizer *r, startedGestures+finishedGestures+notGestures) {
- QMap<QGestureRecognizer*, int>::iterator it = maybeGestures.find(r);
- if (it != maybeGestures.end()) {
+ for(QMap<QGestureRecognizer*, int>::iterator it = maybeGestures.begin();
+ it != maybeGestures.end();) {
+ QGestureRecognizer *r = it.key();
+ if (startedGestures.contains(r) || finishedGestures.contains(r) ||
+ notGestures.contains(r)) {
killTimer(it.value());
- maybeGestures.erase(it);
+ it = maybeGestures.erase(it);
+ } else {
+ ++it;
}
}
foreach(QGestureRecognizer *r, newMaybeGestures) {