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

Mikko Rapeli mikko.rapeli at iki.fi
Sat Jul 14 07:55:52 UTC 2012


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

diff --git a/src/recmonitor.cpp b/src/recmonitor.cpp
index 1ffd419..aec7b36 100644
--- a/src/recmonitor.cpp
+++ b/src/recmonitor.cpp
@@ -267,7 +267,7 @@ void RecMonitor::slotVideoDeviceChanged(int ix)
         m_stopAction->setEnabled(false);
         m_playAction->setEnabled(true);
         capturefile = m_capturePath;
-        if (!capturefile.endsWith("/")) capturefile.append("/");
+        if (!capturefile.endsWith('/')) capturefile.append('/');
         capturename = KdenliveSettings::decklink_filename();
         capturename.append("xxx.");
         capturename.append(KdenliveSettings::decklink_extension());
@@ -289,7 +289,7 @@ void RecMonitor::slotVideoDeviceChanged(int ix)
         } else {
             // Show capture info
             capturefile = m_capturePath;
-            if (!capturefile.endsWith("/")) capturefile.append("/");
+            if (!capturefile.endsWith('/')) capturefile.append('/');
             capturename = KdenliveSettings::dvgrabfilename();
             if (capturename.isEmpty()) capturename = "capture";
             QString extension;
@@ -450,7 +450,7 @@ void RecMonitor::slotStartPreview(bool play)
     QString path;
     MltVideoProfile profile;
     QString producer;
-    QStringList dvargs = KdenliveSettings::dvgrabextra().simplified().split(" ", QString::SkipEmptyParts);
+    QStringList dvargs = KdenliveSettings::dvgrabextra().simplified().split(' ', QString::SkipEmptyParts);
     int ix = device_selector->currentIndex();
     videoBox->setHidden(ix != VIDEO4LINUX && ix != BLACKMAGIC && ix != FIREWIRE);
     switch (ix) {
@@ -704,7 +704,7 @@ void RecMonitor::slotRecord()
                 m_captureArgs << "--channels" << QString::number(KdenliveSettings::rmd_audio_channels());
                 if (KdenliveSettings::rmd_use_jack()) {
                     m_captureArgs << "--use-jack";
-                    QStringList ports = KdenliveSettings::rmd_jackports().split(" ", QString::SkipEmptyParts);
+                    QStringList ports = KdenliveSettings::rmd_jackports().split(' ', QString::SkipEmptyParts);
                     for (int i = 0; i < ports.count(); ++i) {
                         m_captureArgs << ports.at(i);
                     }
@@ -858,7 +858,7 @@ void RecMonitor::manageCapturedFiles()
     QStringList filters;
     QString capturename = KdenliveSettings::dvgrabfilename();
     if (capturename.isEmpty()) capturename = "capture";
-    filters << capturename + "*" + extension;
+    filters << capturename + '*' + extension;
     const QStringList result = dir.entryList(filters, QDir::Files, QDir::Time);
     KUrl::List capturedFiles;
     foreach(const QString & name, result) {
-- 
1.7.10.4





More information about the Kdenlive mailing list