diff options
author | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-01-15 11:23:38 +0300 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2016-01-15 13:58:57 +0000 |
commit | 2e78cf2213c006a96979c5c15534a3263da66995 (patch) | |
tree | e569745836551b3b7e8ed5a89c98a05895af5d20 /src/plugins/gstreamer/camerabin/camerabinsession.cpp | |
parent | 122de0fdc30ffbef569a61710693059a8eded8e0 (diff) |
Gstreamer plugin: replace foreach with range-based for
Change-Id: Ic6d0f9d6b45eae1cdadc46783cb6f5bb7c64ac8c
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Diffstat (limited to 'src/plugins/gstreamer/camerabin/camerabinsession.cpp')
-rw-r--r-- | src/plugins/gstreamer/camerabin/camerabinsession.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.cpp b/src/plugins/gstreamer/camerabin/camerabinsession.cpp index 3dd200c54..95624f711 100644 --- a/src/plugins/gstreamer/camerabin/camerabinsession.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinsession.cpp @@ -496,8 +496,8 @@ GstElement *CameraBinSession::buildCameraSource() const QByteArray envVideoSource = qgetenv("QT_GSTREAMER_CAMERABIN_VIDEOSRC"); if (!envVideoSource.isEmpty()) { - QList<QByteArray> sources = envVideoSource.split(','); - foreach (const QByteArray &source, sources) { + const QList<QByteArray> sources = envVideoSource.split(','); + for (const QByteArray &source : sources) { QList<QByteArray> keyValue = source.split('='); if (keyValue.count() == 1) { m_videoSrc = gst_element_factory_make(keyValue.at(0), "camera_source"); @@ -1363,7 +1363,7 @@ QList<QSize> CameraBinSession::supportedResolutions(QPair<int,int> rate, //if the range is continuos, populate is with the common rates if (isContinuous && res.size() >= 2) { //fill the ragne with common value - static QList<QSize> commonSizes = + static const QList<QSize> commonSizes = QList<QSize>() << QSize(128, 96) << QSize(160,120) << QSize(176, 144) @@ -1385,7 +1385,7 @@ QList<QSize> CameraBinSession::supportedResolutions(QPair<int,int> rate, QSize maxSize = res.last(); res.clear(); - foreach (const QSize &candidate, commonSizes) { + for (const QSize &candidate : commonSizes) { int w = candidate.width(); int h = candidate.height(); |