From: Mohammed Sameer Date: Sat, 22 Sep 2012 21:22:05 +0000 (+0300) Subject: return true if we try to set the resolution and the pipeline is not running X-Git-Url: https://cgit.sxemacs.org/?p=harmattan%2Fcameraplus;a=commitdiff_plain;h=c5ab56e9ddb95af6dcc30f9e0bd9d22015287da4 return true if we try to set the resolution and the pipeline is not running --- diff --git a/lib/qtcamimagemode.cpp b/lib/qtcamimagemode.cpp index 05a6d10..df132d6 100644 --- a/lib/qtcamimagemode.cpp +++ b/lib/qtcamimagemode.cpp @@ -111,8 +111,14 @@ bool QtCamImageMode::capture(const QString& fileName) { bool QtCamImageMode::setResolution(const QtCamImageResolution& resolution) { d->resolution = resolution; + if (!d_ptr->dev->q_ptr->isRunning()) { + // We will return true here because setting the resolution on a non-running pipeline + // doesn't make much sense (Probably the only use case is as a kind of optimization only). + // We will set it anyway when the pipeline gets started. + return true; + } - if (!d_ptr->dev->q_ptr->isRunning() || !d_ptr->dev->q_ptr->isIdle()) { + if (!d_ptr->dev->q_ptr->isIdle()) { return false; }