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

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


Found by cppcheck.
---
 src/kdenlivedoc.cpp |   14 +++++++-------
 src/kdenlivedoc.h   |   18 +++++++++---------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/kdenlivedoc.cpp b/src/kdenlivedoc.cpp
index f453f70..ef76ad0 100644
--- a/src/kdenlivedoc.cpp
+++ b/src/kdenlivedoc.cpp
@@ -54,7 +54,7 @@
 
 const double DOCUMENTVERSION = 0.87;
 
-KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup *undoGroup, QString profileName, QMap <QString, QString> properties, const QPoint tracks, Render *render, KTextEdit *notes, bool *openBackup, MainWindow *parent, KProgressDialog *progressDialog) :
+KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup *undoGroup, QString profileName, QMap <QString, QString> properties, const QPoint &tracks, Render *render, KTextEdit *notes, bool *openBackup, MainWindow *parent, KProgressDialog *progressDialog) :
     QObject(parent),
     m_autosave(NULL),
     m_url(url),
@@ -555,7 +555,7 @@ QPoint KdenliveDoc::zone() const
     return QPoint(m_documentProperties.value("zonein").toInt(), m_documentProperties.value("zoneout").toInt());
 }
 
-QDomDocument KdenliveDoc::xmlSceneList(const QString &scene, const QStringList expandedFolders)
+QDomDocument KdenliveDoc::xmlSceneList(const QString &scene, const QStringList &expandedFolders)
 {
     QDomDocument sceneList;
     sceneList.setContent(scene, true);
@@ -692,7 +692,7 @@ QDomDocument KdenliveDoc::xmlSceneList(const QString &scene, const QStringList e
     return sceneList;
 }
 
-bool KdenliveDoc::saveSceneList(const QString &path, const QString &scene, const QStringList expandedFolders, bool autosave)
+bool KdenliveDoc::saveSceneList(const QString &path, const QString &scene, const QStringList &expandedFolders, bool autosave)
 {
     QDomDocument sceneList = xmlSceneList(scene, expandedFolders);
     if (sceneList.isNull()) {
@@ -896,7 +896,7 @@ Render *KdenliveDoc::renderer()
     return m_render;
 }
 
-void KdenliveDoc::updateClip(const QString id)
+void KdenliveDoc::updateClip(const QString &id)
 {
     emit updateClipDisplay(id);
 }
@@ -1166,7 +1166,7 @@ void KdenliveDoc::deleteClip(const QString &clipId)
     emit signalDeleteProjectClip(clipId);
 }
 
-void KdenliveDoc::slotAddClipList(const KUrl::List urls, const QString group, const QString &groupId)
+void KdenliveDoc::slotAddClipList(const KUrl::List urls, const QString &group, const QString &groupId)
 {
     m_clipManager->slotAddClipList(urls, group, groupId);
     //emit selectLastAddedClip(QString::number(m_clipManager->lastClipId()));
@@ -1174,7 +1174,7 @@ void KdenliveDoc::slotAddClipList(const KUrl::List urls, const QString group, co
 }
 
 
-void KdenliveDoc::slotAddClipFile(const KUrl url, const QString group, const QString &groupId)
+void KdenliveDoc::slotAddClipFile(const KUrl &url, const QString &group, const QString &groupId)
 {
     m_clipManager->slotAddClipFile(url, group, groupId);
     emit selectLastAddedClip(QString::number(m_clipManager->lastClipId()));
@@ -1205,7 +1205,7 @@ void KdenliveDoc::slotCreateColorClip(const QString &name, const QString &color,
     emit selectLastAddedClip(QString::number(m_clipManager->lastClipId()));
 }
 
-void KdenliveDoc::slotCreateSlideshowClipFile(const QString name, const QString path, int count, const QString duration,
+void KdenliveDoc::slotCreateSlideshowClipFile(const QString &name, const QString &path, int count, const QString &duration,
         const bool loop, const bool crop, const bool fade,
         const QString &luma_duration, const QString &luma_file, const int softness,
         const QString &animation, QString group, const QString &groupId)
diff --git a/src/kdenlivedoc.h b/src/kdenlivedoc.h
index 17bbf97..b712a1d 100644
--- a/src/kdenlivedoc.h
+++ b/src/kdenlivedoc.h
@@ -52,7 +52,7 @@ class KdenliveDoc: public QObject
 {
 Q_OBJECT public:
 
-    KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup *undoGroup, QString profileName, QMap <QString, QString> properties, const QPoint tracks, Render *render, KTextEdit *notes, bool *openBackup, MainWindow *parent = 0, KProgressDialog *progressDialog = 0);
+    KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup *undoGroup, QString profileName, QMap <QString, QString> properties, const QPoint &tracks, Render *render, KTextEdit *notes, bool *openBackup, MainWindow *parent = 0, KProgressDialog *progressDialog = 0);
     ~KdenliveDoc();
     QDomNodeList producersList();
     double fps() const;
@@ -83,12 +83,12 @@ Q_OBJECT public:
      *
      * If the clip wasn't added before, it tries to add it to the project. */
     bool addClipInfo(QDomElement elem, QDomElement orig, QString clipId);
-    void slotAddClipFile(const KUrl url, const QString group, const QString &groupId = QString());
-    void slotAddClipList(const KUrl::List urls, const QString group, const QString &groupId = QString());
+    void slotAddClipFile(const KUrl &url, const QString &group, const QString &groupId = QString());
+    void slotAddClipList(const KUrl::List urls, const QString &group, const QString &groupId = QString());
     void deleteClip(const QString &clipId);
     int getFramePos(QString duration);
     DocClipBase *getBaseClip(const QString &clipId);
-    void updateClip(const QString id);
+    void updateClip(const QString &id);
 
     /** @brief Informs Kdenlive of the audio thumbnails generation progress. */
     void setThumbsProgress(const QString &message, int progress);
@@ -113,9 +113,9 @@ Q_OBJECT public:
     double dar() const;
     double projectDuration() const;
     /** @brief Returns the project file xml. */
-    QDomDocument xmlSceneList(const QString &scene, const QStringList expandedFolders);
+    QDomDocument xmlSceneList(const QString &scene, const QStringList &expandedFolders);
     /** @brief Saves the project file xml to a file. */
-    bool saveSceneList(const QString &path, const QString &scene, const QStringList expandedFolders, bool autosave = false);
+    bool saveSceneList(const QString &path, const QString &scene, const QStringList &expandedFolders, bool autosave = false);
     int tracksCount() const;
     TrackInfo trackInfoAt(int ix) const;
     void insertTrack(int ix, TrackInfo type);
@@ -208,8 +208,8 @@ private:
 public slots:
     void slotCreateXmlClip(const QString &name, const QDomElement xml, QString group, const QString &groupId);
     void slotCreateColorClip(const QString &name, const QString &color, const QString &duration, QString group, const QString &groupId);
-    void slotCreateSlideshowClipFile(const QString name, const QString path,
-                                     int count, const QString duration,
+    void slotCreateSlideshowClipFile(const QString &name, const QString &path,
+                                     int count, const QString &duration,
                                      const bool loop, const bool crop,
                                      const bool fade, const QString &luma_duration,
                                      const QString &luma_file, const int softness,
@@ -240,7 +240,7 @@ signals:
     void selectLastAddedClip(const QString &);
     void guidesUpdated();
     /** @brief When creating a backup file, also save a thumbnail of current timeline */
-    void saveTimelinePreview(const QString path);
+    void saveTimelinePreview(const QString &path);
 };
 
 #endif
-- 
1.7.5.4





More information about the Kdenlive mailing list