From ff8f45d83f51c25f67ef555c81e9253fb2258b75 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Wed, 9 Nov 2011 02:53:41 +0100 Subject: [PATCH] Video4linux webcam, only show each format once in case the webcam answers same format several times --- src/wizard.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wizard.cpp b/src/wizard.cpp index 7a8c12ef..7574901a 100644 --- a/src/wizard.cpp +++ b/src/wizard.cpp @@ -219,7 +219,9 @@ void Wizard::slotUpdateCaptureParameters() itemSize = sizes.at(j).section("=", 0, 0); itemRates = sizes.at(j).section("=", 1, 1).split(",", QString::SkipEmptyParts); for (int k = 0; k < itemRates.count(); k++) { - m_capture.v4l_formats->addItem("[" + format + "] " + itemSize + " (" + itemRates.at(k) + ")", QStringList() << format << itemSize.section('x', 0, 0) << itemSize.section('x', 1, 1) << itemRates.at(k).section('/', 0, 0) << itemRates.at(k).section('/', 1, 1)); + QString formatDescription = "[" + format + "] " + itemSize + " (" + itemRates.at(k) + ")"; + if (m_capture.v4l_formats->findText(formatDescription) == -1) + m_capture.v4l_formats->addItem(formatDescription, QStringList() << format << itemSize.section('x', 0, 0) << itemSize.section('x', 1, 1) << itemRates.at(k).section('/', 0, 0) << itemRates.at(k).section('/', 1, 1)); } } } -- 2.39.2