diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-05-12 09:39:16 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-05-18 13:17:09 (GMT) |
commit | ce851964f45266cafd51f2c1ac4e9a7d89ce0ef0 (patch) | |
tree | 81c2373e8f9e1e21eff8d17f6844cdf17a7bd0f8 /src/gui | |
parent | 5c42e4328cc2bea53dc4d31eb3f4d10d42ac6ee1 (diff) | |
download | Qt-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.cpp | 12 |
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) { |