summaryrefslogtreecommitdiffstats
path: root/src/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp
diff options
context:
space:
mode:
authorAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-01-15 11:23:38 +0300
committerYoann Lopes <yoann.lopes@theqtcompany.com>2016-01-15 13:58:57 +0000
commit2e78cf2213c006a96979c5c15534a3263da66995 (patch)
treee569745836551b3b7e8ed5a89c98a05895af5d20 /src/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp
parent122de0fdc30ffbef569a61710693059a8eded8e0 (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/mediacapture/qgstreamerrecordercontrol.cpp')
-rw-r--r--src/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp b/src/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp
index 91bfd67f..d30a2fe6 100644
--- a/src/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp
+++ b/src/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp
@@ -242,7 +242,7 @@ void QGstreamerRecorderControl::applySettings()
QString audioCodec;
QString videoCodec;
- foreach (const QString &containerCandidate, containerCandidates) {
+ for (const QString &containerCandidate : qAsConst(containerCandidates)) {
QSet<QString> supportedTypes = mediaContainerControl->supportedStreamTypes(containerCandidate);
audioCodec.clear();
@@ -250,7 +250,7 @@ void QGstreamerRecorderControl::applySettings()
if (needAudio) {
bool found = false;
- foreach (const QString &audioCandidate, audioCandidates) {
+ for (const QString &audioCandidate : qAsConst(audioCandidates)) {
QSet<QString> audioTypes = audioEncodeControl->supportedStreamTypes(audioCandidate);
if (audioTypes.intersects(supportedTypes)) {
found = true;
@@ -264,7 +264,7 @@ void QGstreamerRecorderControl::applySettings()
if (needVideo) {
bool found = false;
- foreach (const QString &videoCandidate, videoCandidates) {
+ for (const QString &videoCandidate : qAsConst(videoCandidates)) {
QSet<QString> videoTypes = videoEncodeControl->supportedStreamTypes(videoCandidate);
if (videoTypes.intersects(supportedTypes)) {
found = true;
@@ -339,7 +339,7 @@ QDir QGstreamerRecorderControl::defaultDir() const
dirCandidates << QDir::currentPath();
dirCandidates << QDir::tempPath();
- foreach (const QString &path, dirCandidates) {
+ for (const QString &path : qAsConst(dirCandidates)) {
QDir dir(path);
if (dir.exists() && QFileInfo(path).isWritable())
return dir;
@@ -352,7 +352,8 @@ QString QGstreamerRecorderControl::generateFileName(const QDir &dir, const QStri
{
int lastClip = 0;
- foreach(QString fileName, dir.entryList(QStringList() << QString("clip_*.%1").arg(ext))) {
+ const auto list = dir.entryList(QStringList() << QString("clip_*.%1").arg(ext));
+ for (const QString &fileName : list) {
int imgNumber = fileName.midRef(5, fileName.size()-6-ext.length()).toInt();
lastClip = qMax(lastClip, imgNumber);
}