[Kdenlive-devel] [PATCH 13/46] wizard.cpp: Use char for single character

Mikko Rapeli mikko.rapeli at iki.fi
Sat Jul 14 07:56:00 UTC 2012


Should be faster than using a full string. Found by krazy.
---
 src/wizard.cpp |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/wizard.cpp b/src/wizard.cpp
index f62ceff..a0a0c71 100644
--- a/src/wizard.cpp
+++ b/src/wizard.cpp
@@ -213,19 +213,19 @@ void Wizard::slotUpdateCaptureParameters()
         MltVideoProfile profileInfo = ProfilesDialog::getVideoProfile(vl4ProfilePath);
         m_capture.v4l_formats->addItem(i18n("Current settings (%1x%2, %3/%4fps)", profileInfo.width, profileInfo.height, profileInfo.frame_rate_num, profileInfo.frame_rate_den), QStringList() << QString("unknown") <<QString::number(profileInfo.width)<<QString::number(profileInfo.height)<<QString::number(profileInfo.frame_rate_num)<<QString::number(profileInfo.frame_rate_den));
     }
-    QStringList pixelformats = formats.split(">", QString::SkipEmptyParts);
+    QStringList pixelformats = formats.split('>', QString::SkipEmptyParts);
     QString itemSize;
     QString pixelFormat;
     QStringList itemRates;
     for (int i = 0; i < pixelformats.count(); i++) {
         QString format = pixelformats.at(i).section(':', 0, 0);
-        QStringList sizes = pixelformats.at(i).split(":", QString::SkipEmptyParts);
+        QStringList sizes = pixelformats.at(i).split(':', QString::SkipEmptyParts);
         pixelFormat = sizes.takeFirst();
         for (int j = 0; j < sizes.count(); j++) {
-            itemSize = sizes.at(j).section("=", 0, 0);
-            itemRates = sizes.at(j).section("=", 1, 1).split(",", QString::SkipEmptyParts);
+            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++) {
-                QString formatDescription = "[" + format + "] " + itemSize + " (" + itemRates.at(k) + ")";
+                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));
             }
-- 
1.7.10.4





More information about the Kdenlive mailing list