[Kdenlive-devel] [PATCH kdenlive 06/27] const parameters as reference

Mikko Rapeli mikko.rapeli at iki.fi
Sun Aug 28 10:24:46 UTC 2011


Found by cppcheck.
---
 src/definitions.h |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/definitions.h b/src/definitions.h
index 6b0576b..4384e8c 100644
--- a/src/definitions.h
+++ b/src/definitions.h
@@ -101,14 +101,14 @@ struct MltVideoProfile {
 class EffectParameter
 {
 public:
-    EffectParameter(const QString name, const QString value): m_name(name), m_value(value) {}
+    EffectParameter(const QString &name, const QString &value): m_name(name), m_value(value) {}
     QString name()   const          {
         return m_name;
     }
     QString value() const          {
         return m_value;
     }
-    void setValue(const QString value) {
+    void setValue(const QString &value) {
         m_value = value;
     }
 
@@ -124,12 +124,12 @@ class EffectsParameterList: public QList < EffectParameter >
 {
 public:
     EffectsParameterList(): QList < EffectParameter >() {}
-    bool hasParam(const QString name) const {
+    bool hasParam(const QString &name) const {
         for (int i = 0; i < size(); i++)
             if (at(i).name() == name) return true;
         return false;
     }
-    QString paramValue(const QString name, QString defaultValue = QString()) const {
+    QString paramValue(const QString &name, QString defaultValue = QString()) const {
         for (int i = 0; i < size(); i++) {
             if (at(i).name() == name) return at(i).value();
         }
@@ -139,7 +139,7 @@ public:
         if (name.isEmpty()) return;
         append(EffectParameter(name, value));
     }
-    void removeParam(const QString name) {
+    void removeParam(const QString &name) {
         for (int i = 0; i < size(); i++)
             if (at(i).name() == name) {
                 removeAt(i);
@@ -152,7 +152,7 @@ class CommentedTime
 {
 public:
     CommentedTime(): t(GenTime(0)) {}
-    CommentedTime(const GenTime time, QString comment)
+    CommentedTime(const GenTime &time, QString comment)
         : t(time), c(comment) { }
 
     QString comment()   const          {
-- 
1.7.5.4





More information about the Kdenlive mailing list