Use the backend to notify the QCamera state changes.
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>
This commit is contained in:
committed by
The Qt Project
parent
13d7f835fa
commit
9ceb1c083e
@@ -175,8 +175,6 @@ void QCameraPrivate::_q_error(int error, const QString &errorString)
|
||||
|
||||
void QCameraPrivate::setState(QCamera::State newState)
|
||||
{
|
||||
Q_Q(QCamera);
|
||||
|
||||
unsetError();
|
||||
|
||||
if (!control) {
|
||||
@@ -184,13 +182,8 @@ void QCameraPrivate::setState(QCamera::State newState)
|
||||
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)
|
||||
@@ -203,7 +196,6 @@ void QCameraPrivate::_q_updateState(QCamera::State newState)
|
||||
return;
|
||||
|
||||
if (newState != state) {
|
||||
qDebug() << "Camera state changed:" << newState;
|
||||
state = newState;
|
||||
emit q->stateChanged(state);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user