From: Yoann Lopes Date: Thu, 5 Dec 2013 16:47:49 +0000 (+0100) Subject: Use the backend to notify the QCamera state changes. X-Git-Tag: accepted/tizen/generic/20140129.173457~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ceb1c083e4f6911ace1af3c9dfa6b4dd9036586;p=platform%2Fupstream%2Fqtmultimedia.git 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 --- diff --git a/src/multimedia/camera/qcamera.cpp b/src/multimedia/camera/qcamera.cpp index 5b0f0d1..e91a031 100644 --- a/src/multimedia/camera/qcamera.cpp +++ b/src/multimedia/camera/qcamera.cpp @@ -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); }