We were emitting the stateChanged() signal no matter what was actually
done by the backend. QCamera now emits this signal only if the backend
actually changed the state.
Task-number: QTBUG-35070
Change-Id: I9f32361cd815dbcc366ad30033692f9ae732ec46
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
void QCameraPrivate::setState(QCamera::State newState)
{
- Q_Q(QCamera);
-
unsetError();
if (!control) {
return;
}
- if (state == newState)
- return;
-
restartPending = false;
- state = newState;
- control->setState(state);
- emit q->stateChanged(state);
+ control->setState(newState);
}
void QCameraPrivate::_q_updateState(QCamera::State newState)
return;
if (newState != state) {
- qDebug() << "Camera state changed:" << newState;
state = newState;
emit q->stateChanged(state);
}