on xenial help sign in
trivial fixes
c477c78Lukáš Tinkl
plugins/Ubuntu/Gestures/TouchGestureArea.cpp+7−9
@@ -374,7 +374,7 @@ void TouchGestureArea::unownedTouchEvent_waitingForMoreTouches(QTouchEvent *even
374 }
374 }
375 }
375 }
376
376
377− if (m_candidateTouches.count() == 0) {
377+ if (m_candidateTouches.isEmpty()) {
378 setInternalStatus(InternalStatus::WaitingForTouch);
378 setInternalStatus(InternalStatus::WaitingForTouch);
379 }
379 }
380}
380}
@@ -438,7 +438,7 @@ void TouchGestureArea::unownedTouchEvent_rejected(QTouchEvent *event)
438 }
438 }
439 }
439 }
440
440
441− if (m_watchedTouches.count() == 0) {
441+ if (m_watchedTouches.isEmpty()) {
442 setInternalStatus(InternalStatus::WaitingForTouch);
442 setInternalStatus(InternalStatus::WaitingForTouch);
443 }
443 }
444}
444}
@@ -526,7 +526,7 @@ void TouchGestureArea::updateTouchPoints(QTouchEvent *touchEvent)
526 if (updateable) {
526 if (updateable) {
527 if (!dragging() && m_status == InternalStatus::Recognized) {
527 if (!dragging() && m_status == InternalStatus::Recognized) {
528 bool allWantDrag = !m_liveTouchPoints.isEmpty();
528 bool allWantDrag = !m_liveTouchPoints.isEmpty();
529− Q_FOREACH(auto point, m_liveTouchPoints) {
529+ Q_FOREACH(const auto &point, m_liveTouchPoints) {
530 allWantDrag &= point->dragging();
530 allWantDrag &= point->dragging();
531 }
531 }
532 // only dragging if all points are dragging.
532 // only dragging if all points are dragging.
@@ -643,11 +643,9 @@ bool TouchGestureArea::dragging() const
643QQmlListProperty<GestureTouchPoint> TouchGestureArea::touchPoints()
643QQmlListProperty<GestureTouchPoint> TouchGestureArea::touchPoints()
644{
644{
645 return QQmlListProperty<GestureTouchPoint>(this,
645 return QQmlListProperty<GestureTouchPoint>(this,
646− 0,
647− nullptr,
646+ nullptr,
648− TouchGestureArea::touchPoint_count,
647+ TouchGestureArea::touchPoint_count,
649− TouchGestureArea::touchPoint_at,
648+ TouchGestureArea::touchPoint_at);
650− 0);
651}
649}
652
650
653int TouchGestureArea::minimumTouchPoints() const
651int TouchGestureArea::minimumTouchPoints() const
@@ -718,7 +716,7 @@ void TouchGestureArea::rejectGesture()
718 }
716 }
719 m_candidateTouches.clear();
717 m_candidateTouches.clear();
720
718
721− if (m_watchedTouches.count() == 0) {
719+ if (m_watchedTouches.isEmpty()) {
722 setInternalStatus(InternalStatus::WaitingForTouch);
720 setInternalStatus(InternalStatus::WaitingForTouch);
723 } else {
721 } else {
724 setInternalStatus(InternalStatus::Rejected);
722 setInternalStatus(InternalStatus::Rejected);
plugins/Ubuntu/Gestures/TouchGestureArea.h+5−5
@@ -137,7 +137,7 @@ public:
137 Recognized,
137 Recognized,
138 Rejected
138 Rejected
139 };
139 };
140− TouchGestureArea(QQuickItem* parent = NULL);
140+ TouchGestureArea(QQuickItem* parent = nullptr);
141 ~TouchGestureArea();
141 ~TouchGestureArea();
142
142
143 bool event(QEvent *e) override;
143 bool event(QEvent *e) override;
@@ -165,10 +165,10 @@ Q_SIGNALS:
165
165
166 void touchPointsUpdated();
166 void touchPointsUpdated();
167 void draggingChanged(bool dragging);
167 void draggingChanged(bool dragging);
168− void minimumTouchPointsChanged(bool value);
168+ void minimumTouchPointsChanged(int value);
169− void maximumTouchPointsChanged(bool value);
169+ void maximumTouchPointsChanged(int value);
170− void recognitionPeriodChanged(bool value);
170+ void recognitionPeriodChanged(int value);
171− void releaseRejectPeriodChanged(bool value);
171+ void releaseRejectPeriodChanged(int value);
172
172
173 void pressed(const QList<QObject*>& points);
173 void pressed(const QList<QObject*>& points);
174 void released(const QList<QObject*>& points);
174 void released(const QList<QObject*>& points);