on xenial help sign in
Make AxisVelocityCalculator::setTimeSource() more robust.
9cb758aDaniel d'Andrada
plugins/Ubuntu/Gestures/AxisVelocityCalculator.cpp+7
@@ -148,4 +148,11 @@ void AxisVelocityCalculator::setTimeSource(UbuntuGestures::TimeSource *timeSourc
148 delete m_timeSource;
148 delete m_timeSource;
149
149
150 m_timeSource = timeSource;
150 m_timeSource = timeSource;
151+
152+ if (numSamples() > 0) {
153+ qWarning("AxisVelocityCalculator: changing time source while there are samples present.");
154+ // Any existent samples are based on the old time source and are, therefore, incompatible
155+ // with this new one.
156+ reset();
157+ }
151}
158}