Commit 346e36d4 authored by Thiago Santini's avatar Thiago Santini

Update settings regardless of failure

parent 08e920f3
......@@ -165,13 +165,17 @@ void Camera::setCamera(const QCameraInfo &cameraInfo, QCameraViewfinderSettings
if (settings.isNull())
settings = getViewfinderSettings(cameraInfo);
currentCameraInfo = cameraInfo;
currentViewfinderSettings = settings;
settingsList = camera->supportedViewfinderSettings();
QMetaObject::invokeMethod(ui, "updateSettings", Q_ARG(QList<QCameraViewfinderSettings>, settingsList), Q_ARG(QCameraViewfinderSettings, currentViewfinderSettings) );
camera->setViewfinderSettings(settings);
camera->setViewfinder(frameGrabber);
camera->start();
if (camera->state() != QCamera::ActiveState) {
qInfo() << id << cameraInfo.description() << "failed to start (" << settings << ")\n" << camera->errorString();
reset();
emit noCamera("Failed to start.");
return;
}
......@@ -182,9 +186,6 @@ void Camera::setCamera(const QCameraInfo &cameraInfo, QCameraViewfinderSettings
this, SLOT(timedout()) );
fps = settings.maximumFrameRate();
currentCameraInfo = cameraInfo;
currentViewfinderSettings = settings;
settingsList = camera->supportedViewfinderSettings();
msg = currentCameraInfo.description() + " " + toQString(settings);
retriesLeft = maxRetries;
}
......@@ -193,7 +194,6 @@ void Camera::setCamera(const QCameraInfo &cameraInfo, QCameraViewfinderSettings
setValuesUI();
saveCfg();
qInfo() << id << msg;
QMetaObject::invokeMethod(ui, "updateSettings", Q_ARG(QList<QCameraViewfinderSettings>, settingsList), Q_ARG(QCameraViewfinderSettings, currentViewfinderSettings) );
}
void Camera::setColorCode(int code)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment