on xenial help sign in
trivial fixes
commitc477c78ad0e091e0e464776ac1f5ff005b4465ec authorLukáš Tinkl <lukas.tinkl@canonical.com> dateWed 30 Mar 2016, 00:10 (11 years ago) parent898b8f3
2 files changed+12−14
plugins/Ubuntu/Gestures/TouchGestureArea.cpp+7−9 plugins/Ubuntu/Gestures/TouchGestureArea.h+5−5
plugins/Ubuntu/Gestures/TouchGestureArea.cpp+7−9
@@ -374,7 +374,7 @@ void TouchGestureArea::unownedTouchEvent_waitingForMoreTouches(QTouchEvent *even
374374 }
375375 }
376376
377− if (m_candidateTouches.count() == 0) {
377+ if (m_candidateTouches.isEmpty()) {
378378 setInternalStatus(InternalStatus::WaitingForTouch);
379379 }
380380}
@@ -438,7 +438,7 @@ void TouchGestureArea::unownedTouchEvent_rejected(QTouchEvent *event)
438438 }
439439 }
440440
441− if (m_watchedTouches.count() == 0) {
441+ if (m_watchedTouches.isEmpty()) {
442442 setInternalStatus(InternalStatus::WaitingForTouch);
443443 }
444444}
@@ -526,7 +526,7 @@ void TouchGestureArea::updateTouchPoints(QTouchEvent *touchEvent)
526526 if (updateable) {
527527 if (!dragging() && m_status == InternalStatus::Recognized) {
528528 bool allWantDrag = !m_liveTouchPoints.isEmpty();
529− Q_FOREACH(auto point, m_liveTouchPoints) {
529+ Q_FOREACH(const auto &point, m_liveTouchPoints) {
530530 allWantDrag &= point->dragging();
531531 }
532532 // only dragging if all points are dragging.
@@ -643,11 +643,9 @@ bool TouchGestureArea::dragging() const
643643QQmlListProperty<GestureTouchPoint> TouchGestureArea::touchPoints()
644644{
645645 return QQmlListProperty<GestureTouchPoint>(this,
646− 0,
647− nullptr,
648− TouchGestureArea::touchPoint_count,
649− TouchGestureArea::touchPoint_at,
650− 0);
646+ nullptr,
647+ TouchGestureArea::touchPoint_count,
648+ TouchGestureArea::touchPoint_at);
651649}
652650
653651int TouchGestureArea::minimumTouchPoints() const
@@ -718,7 +716,7 @@ void TouchGestureArea::rejectGesture()
718716 }
719717 m_candidateTouches.clear();
720718
721− if (m_watchedTouches.count() == 0) {
719+ if (m_watchedTouches.isEmpty()) {
722720 setInternalStatus(InternalStatus::WaitingForTouch);
723721 } else {
724722 setInternalStatus(InternalStatus::Rejected);
plugins/Ubuntu/Gestures/TouchGestureArea.h+5−5
@@ -137,7 +137,7 @@ public:
137137 Recognized,
138138 Rejected
139139 };
140− TouchGestureArea(QQuickItem* parent = NULL);
140+ TouchGestureArea(QQuickItem* parent = nullptr);
141141 ~TouchGestureArea();
142142
143143 bool event(QEvent *e) override;
@@ -165,10 +165,10 @@ Q_SIGNALS:
165165
166166 void touchPointsUpdated();
167167 void draggingChanged(bool dragging);
168− void minimumTouchPointsChanged(bool value);
169− void maximumTouchPointsChanged(bool value);
170− void recognitionPeriodChanged(bool value);
171− void releaseRejectPeriodChanged(bool value);
168+ void minimumTouchPointsChanged(int value);
169+ void maximumTouchPointsChanged(int value);
170+ void recognitionPeriodChanged(int value);
171+ void releaseRejectPeriodChanged(int value);
172172
173173 void pressed(const QList<QObject*>& points);
174174 void released(const QList<QObject*>& points);