]> git.sesse.net Git - kdenlive/commitdiff
Add explicit keyword, const'ref, minor optimization
authorMontel Laurent <montel@kde.org>
Mon, 13 May 2013 19:02:14 +0000 (21:02 +0200)
committerMontel Laurent <montel@kde.org>
Mon, 13 May 2013 19:02:14 +0000 (21:02 +0200)
34 files changed:
src/abstractclipitem.cpp
src/abstractclipitem.h
src/beziercurve/beziersplineeditor.cpp
src/beziercurve/beziersplineeditor.h
src/beziercurve/cubicbezierspline.h
src/clipproperties.cpp
src/clipproperties.h
src/colorcorrection/histogramgenerator.h
src/commands/addeffectcommand.cpp
src/commands/addeffectcommand.h
src/commands/changespeedcommand.cpp
src/commands/changespeedcommand.h
src/commands/editguidecommand.cpp
src/commands/editguidecommand.h
src/commands/editkeyframecommand.cpp
src/commands/editkeyframecommand.h
src/commands/movegroupcommand.cpp
src/commands/movegroupcommand.h
src/commands/razorclipcommand.cpp
src/commands/razorclipcommand.h
src/customruler.cpp
src/customruler.h
src/customtrackscene.cpp
src/customtrackscene.h
src/rotoscoping/rotowidget.h
src/scopes/audioscopes/audiosignal.h
src/scopes/audioscopes/audiospectrum.h
src/scopes/colorscopes/histogram.h
src/scopes/colorscopes/rgbparade.h
src/scopes/colorscopes/vectorscope.h
src/scopes/colorscopes/waveform.h
src/simplekeyframes/simplekeyframewidget.h
src/simplekeyframes/simpletimelinewidget.h
src/utils/archiveorg.h

index b333427f27cadd9463508bfbd1b9d31464905436..9979b6dd7ac36ff0f8a35d45d1463d011d9e918f 100644 (file)
@@ -122,7 +122,7 @@ GenTime AbstractClipItem::cropDuration() const
     return m_info.cropDuration;
 }
 
-void AbstractClipItem::setCropStart(GenTime pos)
+void AbstractClipItem::setCropStart(const GenTime &pos)
 {
     m_info.cropStart = pos;
 }
index 4d26679cac3e8ffcac2f25440f99129417613f17..f2a5bed5484aaa1635b255ab452cdfa19cb2d449 100644 (file)
@@ -92,7 +92,7 @@ public:
     virtual double fps() const;
     virtual void updateFps(double fps);
     virtual GenTime maxDuration() const;
-    virtual void setCropStart(GenTime pos);
+    virtual void setCropStart(const GenTime &pos);
 
     /** @brief Set this clip as the main selected clip (or not). */
     void setMainSelectedClip(bool selected);
index 89bcdd1eb35f4552ab53f143ed1c6cf603ba83bb..2ea438302bf49929eb2ed5bfd16dbc628a93edca 100644 (file)
@@ -106,11 +106,13 @@ void BezierSplineEditor::slotZoomOut()
 
 void BezierSplineEditor::setShowAllHandles(bool show)
 {
-    m_showAllHandles = show;
-    update();
+    if (m_showAllHandles != show) {
+        m_showAllHandles = show;
+        update();
+    }
 }
 
-int BezierSplineEditor::gridLines()
+int BezierSplineEditor::gridLines() const
 {
     return m_gridLines;
 }
@@ -461,7 +463,7 @@ void BezierSplineEditor::leaveEvent(QEvent* event)
     QWidget::leaveEvent(event);
 }
 
-int BezierSplineEditor::nearestPointInRange(QPointF p, int wWidth, int wHeight, BezierSplineEditor::point_types* sel)
+int BezierSplineEditor::nearestPointInRange(const QPointF &p, int wWidth, int wHeight, BezierSplineEditor::point_types* sel)
 {
     double nearestDistanceSquared = 1000;
     point_types selectedPoint = PTypeP;
index e601e8ed69defdd10b1a714a1914a0a03d7effa0..d0f267ca9c66fc7cc8527b645d0c97c5325d9c78 100644 (file)
@@ -29,8 +29,8 @@ class BezierSplineEditor : public QWidget
     Q_OBJECT
 
 public:
-    BezierSplineEditor(QWidget* parent = 0);
-    virtual ~BezierSplineEditor();
+    explicit BezierSplineEditor(QWidget* parent = 0);
+    ~BezierSplineEditor();
 
     CubicBezierSpline spline() const;
     void setSpline(const CubicBezierSpline &spline);
@@ -43,7 +43,7 @@ public:
     void updateCurrentPoint(const BPoint &p, bool final = true);
 
     /** @brief Number of lines used in grid. */
-    int gridLines();
+    int gridLines() const;
 
     /** @brief Sets the number of grid lines to draw (in one direction) to @param lines. */
     void setGridLines(int lines);
@@ -100,7 +100,7 @@ private:
      * @param sel Is filled with the type of the closest point (h1, p, h2)
      *
      * If no point is near enough -1 is returned. */
-    int nearestPointInRange(QPointF p, int wWidth, int wHeight, point_types *sel);
+    int nearestPointInRange(const QPointF &p, int wWidth, int wHeight, point_types *sel);
 
 signals:
     void modified();
index ee21c987f5f7b9e58d116e03f8dfae433f05b210..21024bd2da946e6fb2a982c2593f0c220d715f1c 100644 (file)
@@ -29,7 +29,7 @@ class CubicBezierSpline : public QObject
     Q_OBJECT
 
 public:
-    CubicBezierSpline(QObject* parent = 0);
+    explicit CubicBezierSpline(QObject* parent = 0);
     CubicBezierSpline(const CubicBezierSpline &spline, QObject* parent = 0);
     CubicBezierSpline& operator=(const CubicBezierSpline &spline);
 
index 6f5366c64d669e4c71be4d0c90c8cc9b185d133d..d2c764703c7cb379fc02380e40dc7035b7ab4b90 100644 (file)
@@ -539,7 +539,7 @@ ClipProperties::ClipProperties(DocClipBase *clip, const Timecode &tc, double fps
 
 
 // Used for multiple clips editing
-ClipProperties::ClipProperties(QList <DocClipBase *>cliplist, Timecode tc, QMap <QString, QString> commonproperties, QWidget * parent) :
+ClipProperties::ClipProperties(QList <DocClipBase *>cliplist, const Timecode &tc, QMap <QString, QString> commonproperties, QWidget * parent) :
     QDialog(parent),
     m_clip(NULL),
     m_tc(tc),
index 19b5bc7d57d475768ea11d5906890780c5b91604..7221878967d098a066e71a23c9f1d7be3957ce50 100644 (file)
@@ -48,7 +48,7 @@ class ClipProperties : public QDialog
 
 public:
     ClipProperties(DocClipBase *clip, const Timecode &tc, double fps, QWidget * parent = 0);
-    ClipProperties(QList <DocClipBase *>cliplist, Timecode tc, QMap <QString, QString> commonproperties, QWidget * parent);
+    ClipProperties(QList <DocClipBase *>cliplist, const Timecode &tc, QMap <QString, QString> commonproperties, QWidget * parent);
     virtual ~ClipProperties();
     QMap <QString, QString> properties();
     const QString &clipId() const;
index cfce26f4cf23becd345857a5c1d219af9f6071f8..9e28f0f0afae2fd677e3579b993f1a923304c794 100644 (file)
@@ -22,7 +22,7 @@ class QSize;
 class HistogramGenerator : public QObject
 {
 public:
-    HistogramGenerator();
+    explicit HistogramGenerator();
 
     /** Recommendation to use.
         See http://www.poynton.com/ColorFAQ.html for details. */
index e720caa15f0d53f3f0576c588e3e1efafe4b154a..f858ecb3fd53722aab173439a3b4e985a16efded 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <KLocale>
 
-AddEffectCommand::AddEffectCommand(CustomTrackView *view, const int track, GenTime pos, const QDomElement &effect, bool doIt, QUndoCommand * parent) :
+AddEffectCommand::AddEffectCommand(CustomTrackView *view, const int track, const GenTime &pos, const QDomElement &effect, bool doIt, QUndoCommand * parent) :
         QUndoCommand(parent),
         m_view(view),
         m_track(track),
index 5856a05ab6bc62b17d746ddbad3cf80d853d03d7..0f01a72535998572f2d64d4097a455a3ee3a3b85 100644 (file)
@@ -31,7 +31,7 @@ class CustomTrackView;
 class AddEffectCommand : public QUndoCommand
 {
 public:
-    AddEffectCommand(CustomTrackView *view, const int track, GenTime pos, const QDomElement &effect, bool doIt, QUndoCommand * parent = 0);
+    AddEffectCommand(CustomTrackView *view, const int track, const GenTime &pos, const QDomElement &effect, bool doIt, QUndoCommand * parent = 0);
 
     virtual void undo();
     virtual void redo();
index f775c6813c24e0afdd9f211ec319fae0c77c7571..67399a91e21920aafdd066f4caca69f5453e7e95 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <KLocale>
 
-ChangeSpeedCommand::ChangeSpeedCommand(CustomTrackView *view, ItemInfo info, ItemInfo speedIndependantInfo, double old_speed, double new_speed, int old_strobe, int new_strobe, const QString &clipId, QUndoCommand * parent) :
+ChangeSpeedCommand::ChangeSpeedCommand(CustomTrackView *view, const ItemInfo &info, const ItemInfo &speedIndependantInfo, double old_speed, double new_speed, int old_strobe, int new_strobe, const QString &clipId, QUndoCommand * parent) :
         QUndoCommand(parent),
         m_view(view),
         m_clipInfo(info),
index 8adb5fc5092c7fde1d508c7f96b9d3546cea6ac5..4640f15f1ba4b4214d7231c19265485fb2af0bbf 100644 (file)
@@ -33,7 +33,7 @@ class CustomTrackView;
 class ChangeSpeedCommand : public QUndoCommand
 {
 public:
-    ChangeSpeedCommand(CustomTrackView *view, ItemInfo info, ItemInfo speedIndependantInfo, double old_speed, double new_speed, int old_strobe, int new_strobe, const QString &clipId, QUndoCommand * parent = 0);
+    ChangeSpeedCommand(CustomTrackView *view, const ItemInfo &info, const ItemInfo &speedIndependantInfo, double old_speed, double new_speed, int old_strobe, int new_strobe, const QString &clipId, QUndoCommand * parent = 0);
     virtual void undo();
     virtual void redo();
 
index 30398da8e7c32fa7d5a83dcee6798963c4c02243..7e12a7b38a448b470b228ea5b47b02f3996c30cd 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <KLocale>
 
-EditGuideCommand::EditGuideCommand(CustomTrackView *view, const GenTime oldPos, const QString &oldcomment, const GenTime pos, const QString &comment, bool doIt, QUndoCommand * parent) :
+EditGuideCommand::EditGuideCommand(CustomTrackView *view, const GenTime &oldPos, const QString &oldcomment, const GenTime &pos, const QString &comment, bool doIt, QUndoCommand * parent) :
         QUndoCommand(parent),
         m_view(view),
         m_oldcomment(oldcomment),
index b271220c15e423d5f065b97a6bc403f6840bb344..189f5e4bccc3ab5f7cafddd19d10675939598d11 100644 (file)
@@ -32,7 +32,7 @@ class CustomTrackView;
 class EditGuideCommand : public QUndoCommand
 {
 public:
-    EditGuideCommand(CustomTrackView *view, const GenTime oldPos, const QString &oldcomment, const GenTime pos, const QString &comment, bool doIt, QUndoCommand * parent = 0);
+    EditGuideCommand(CustomTrackView *view, const GenTime &oldPos, const QString &oldcomment, const GenTime &pos, const QString &comment, bool doIt, QUndoCommand * parent = 0);
     virtual void undo();
     virtual void redo();
 
index 29c341ca24e47991373dbe0f55cd9c5ef2dd760a..64b7a29dd668e81e41b8925eb81ba8a1ba5ab067 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <KLocale>
 
-EditKeyFrameCommand::EditKeyFrameCommand(CustomTrackView *view, const int track, GenTime pos, const int effectIndex, const QString& oldkeyframes, const QString& newkeyframes, bool doIt) :
+EditKeyFrameCommand::EditKeyFrameCommand(CustomTrackView *view, const int track, const GenTime &pos, const int effectIndex, const QString& oldkeyframes, const QString& newkeyframes, bool doIt) :
         QUndoCommand(),
         m_view(view),
         m_oldkfr(oldkeyframes),
index e35603fa957a0b2b9fd4486c2a94ca7d2ff7240e..2a2b5b2be39445e2f70a046a9bbe70ce711138ea 100644 (file)
@@ -32,7 +32,7 @@ class CustomTrackView;
 class EditKeyFrameCommand : public QUndoCommand
 {
 public:
-    EditKeyFrameCommand(CustomTrackView *view, const int track, GenTime pos, const int effectIndex, const QString& oldkeyframes, const QString& newkeyframes, bool doIt);
+    EditKeyFrameCommand(CustomTrackView *view, const int track, const GenTime &pos, const int effectIndex, const QString& oldkeyframes, const QString& newkeyframes, bool doIt);
     virtual void undo();
     virtual void redo();
 
index ecfe2519902aab2aebf0a334e1f0c7a9293445fa..efc0f3e8487ecb41cc1f3834c692b9df18a8c096 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <KLocale>
 
-MoveGroupCommand::MoveGroupCommand(CustomTrackView *view, const QList <ItemInfo> &startClip, const QList <ItemInfo> &startTransition, const GenTime offset, const int trackOffset, bool doIt, QUndoCommand * parent) :
+MoveGroupCommand::MoveGroupCommand(CustomTrackView *view, const QList <ItemInfo> &startClip, const QList <ItemInfo> &startTransition, const GenTime &offset, const int trackOffset, bool doIt, QUndoCommand * parent) :
         QUndoCommand(parent),
         m_view(view),
         m_startClip(startClip),
index 66f8d26e5e2dd77776ea307f0da8baf0a81f1189..c2df2644329d8a320c431430ef8b821b4cad10a7 100644 (file)
@@ -30,7 +30,7 @@ class CustomTrackView;
 class MoveGroupCommand : public QUndoCommand
 {
 public:
-    MoveGroupCommand(CustomTrackView *view, const QList <ItemInfo> &startClip, const QList <ItemInfo> &startTransition, const GenTime offset, const int trackOffset, bool doIt, QUndoCommand * parent = 0);
+    MoveGroupCommand(CustomTrackView *view, const QList <ItemInfo> &startClip, const QList <ItemInfo> &startTransition, const GenTime &offset, const int trackOffset, bool doIt, QUndoCommand * parent = 0);
     virtual void undo();
     virtual void redo();
 
index 53257ebb40be78a8c6070f8717e0dc3c268f6621..07af951c3695d0099e67fb660848012ce5a7b80c 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <KLocale>
 
-RazorClipCommand::RazorClipCommand(CustomTrackView *view, const ItemInfo &info, EffectsList stack, const GenTime cutTime, bool doIt, QUndoCommand * parent) :
+RazorClipCommand::RazorClipCommand(CustomTrackView *view, const ItemInfo &info, EffectsList stack, const GenTime &cutTime, bool doIt, QUndoCommand * parent) :
         QUndoCommand(parent),
         m_view(view),
         m_info(info),
index 0da865ac68c00a28f48e37c8a5ec64112eeb9a15..1f01cd204c87bc850d58d330301ff0a3d15c6c07 100644 (file)
@@ -33,7 +33,7 @@ class CustomTrackView;
 class RazorClipCommand : public QUndoCommand
 {
 public:
-    RazorClipCommand(CustomTrackView *view, const ItemInfo &info, EffectsList stack, const GenTime cutTime, bool doIt = true, QUndoCommand * parent = 0);
+    RazorClipCommand(CustomTrackView *view, const ItemInfo &info, EffectsList stack, const GenTime &cutTime, bool doIt = true, QUndoCommand * parent = 0);
     virtual void undo();
     virtual void redo();
 
index 54cafd6add1bfc0b32befee293fec05de951cf15..b7126ae0214c926c1f70d86a50e240f54cd7797c 100644 (file)
@@ -50,7 +50,7 @@ static int bigMarkDistance;
 
 const int CustomRuler::comboScale[] = { 1, 2, 5, 10, 25, 50, 125, 250, 500, 750, 1500, 3000, 6000, 12000};
 
-CustomRuler::CustomRuler(Timecode tc, CustomTrackView *parent) :
+CustomRuler::CustomRuler(const Timecode &tc, CustomTrackView *parent) :
         QWidget(parent),
         m_timecode(tc),
         m_view(parent),
index f7ba21bd61f521cb859f31e827dfaa5e3c9d1581..1bebf0b3cd9b9f6e1e6513b87f921d03aaa67a54 100644 (file)
@@ -39,7 +39,7 @@ class CustomRuler : public QWidget
     Q_OBJECT
 
 public:
-    CustomRuler(Timecode tc, CustomTrackView *parent);
+    CustomRuler(const Timecode &tc, CustomTrackView *parent);
     void setPixelPerMark(int rate);
     static const int comboScale[];
     int outPoint() const;
index ba243695662e66e75c014ea529fa097e65dfdfc6..44e1a9bffd6aa0c4bef5dd69157ee7e21e06dc86 100644 (file)
@@ -55,7 +55,7 @@ void CustomTrackScene::setSnapList(const QList <GenTime>& snaps)
     m_snapPoints = snaps;
 }
 
-GenTime CustomTrackScene::previousSnapPoint(GenTime pos) const
+GenTime CustomTrackScene::previousSnapPoint(const GenTime &pos) const
 {
     for (int i = 0; i < m_snapPoints.size(); ++i) {
         if (m_snapPoints.at(i) >= pos) {
@@ -66,7 +66,7 @@ GenTime CustomTrackScene::previousSnapPoint(GenTime pos) const
     return GenTime();
 }
 
-GenTime CustomTrackScene::nextSnapPoint(GenTime pos) const
+GenTime CustomTrackScene::nextSnapPoint(const GenTime &pos) const
 {
     for (int i = 0; i < m_snapPoints.size(); ++i) {
         if (m_snapPoints.at(i) > pos) {
index ade17bc57ad586c05afc7304f8dae9d97a1d5cbf..c9506568c6508ce3b04d5aae123fd42e52b8c0be 100644 (file)
@@ -43,10 +43,10 @@ class CustomTrackScene : public QGraphicsScene
 
 public:
     explicit CustomTrackScene(KdenliveDoc *doc, QObject *parent = 0);
-    virtual ~ CustomTrackScene();
+    ~CustomTrackScene();
     void setSnapList(const QList <GenTime>& snaps);
-    GenTime previousSnapPoint(GenTime pos) const;
-    GenTime nextSnapPoint(GenTime pos) const;
+    GenTime previousSnapPoint(const GenTime &pos) const;
+    GenTime nextSnapPoint(const GenTime &pos) const;
     double getSnapPointForPos(double pos, bool doSnap = true);
     void setScale(double scale, double vscale);
     QPointF scale() const;
index 99523b8b3063d1a8e51b28961987d6f55e197512..444d673ec2b8144431eedf76bea950e3622bb7b7 100644 (file)
@@ -43,7 +43,7 @@ class RotoWidget : public QWidget
 
 public:
     RotoWidget(const QString &data, Monitor *monitor, const ItemInfo &info, const Timecode &t, QWidget* parent = 0);
-    virtual ~RotoWidget();
+    ~RotoWidget();
 
     /** @brief Returns the spline(s) in the JSON format used by filter_rotoscoping (MLT). */
     QString getSpline();
index 9c057fffd1862a79b4aed56c1476e45ff213197c..bf8b7a67da820610f353028b680f14f1d14824f5 100644 (file)
@@ -35,7 +35,7 @@ class AudioSignal : public AbstractAudioScopeWidget
 {
     Q_OBJECT
 public:
-    AudioSignal(QWidget *parent = 0);
+    explicit AudioSignal(QWidget *parent = 0);
     ~AudioSignal();
     /** @brief Used for checking whether audio data needs to be delivered */
     bool monitoringEnabled() const;
index b8e935785b8a720dc30f880f02d8245bc83a62db..94c8b2940c684df96cff6a2b4df33e63515d7a54 100644 (file)
@@ -40,7 +40,7 @@ class AudioSpectrum : public AbstractAudioScopeWidget {
     Q_OBJECT
 
 public:
-    AudioSpectrum(QWidget *parent = 0);
+    explicit AudioSpectrum(QWidget *parent = 0);
     ~AudioSpectrum();
 
     // Implemented virtual methods
index 85a954a2994d5c6f83df3fc52dbefdd119b7c4f7..f2b4dd3af874828749c96e26490b2df2871f0bbd 100644 (file)
@@ -23,7 +23,7 @@ class Histogram : public AbstractGfxScopeWidget {
     Q_OBJECT
 
 public:
-    Histogram(QWidget *parent = 0);
+    explicit Histogram(QWidget *parent = 0);
     ~Histogram();
     QString widgetName() const;
 
index 1d6a3c6dcf74085296e77e919a45aed2fbd9ea38..6fadd353f67edfbc3c81430aee1078b539dabb8e 100644 (file)
@@ -26,7 +26,7 @@ class RGBParadeGenerator;
 class RGBParade : public AbstractGfxScopeWidget
 {
 public:
-    RGBParade(QWidget *parent = 0);
+    explicit RGBParade(QWidget *parent = 0);
     ~RGBParade();
     QString widgetName() const;
 
index adeba60ab5b2943da3efc1ea6aef7db02ff7d16d..51166633a77a62023b990b56dbcd4567241fcf13 100644 (file)
@@ -32,7 +32,7 @@ class Vectorscope : public AbstractGfxScopeWidget {
     Q_OBJECT
 
 public:
-    Vectorscope(QWidget *parent = 0);
+    explicit Vectorscope(QWidget *parent = 0);
     ~Vectorscope();
 
     QString widgetName() const;
index 2455f81731e6f5573e1d12747456e604aa190686..05950dbd60c51838c23dee2881975abb0994ecd9 100644 (file)
@@ -27,7 +27,7 @@ class Waveform : public AbstractGfxScopeWidget {
     Q_OBJECT
 
 public:
-    Waveform(QWidget *parent = 0);
+    explicit Waveform(QWidget *parent = 0);
     ~Waveform();
 
     virtual QString widgetName() const;
index d9553ba64400553cf28148b3a5029a2040204b4e..5564e0aca81acde8c6eb84f280d1177054834281 100644 (file)
@@ -34,8 +34,8 @@ class SimpleKeyframeWidget : public QWidget
     Q_OBJECT
 
 public:
-    SimpleKeyframeWidget(const Timecode &t, int duration, QWidget* parent = 0);
-    virtual ~SimpleKeyframeWidget();
+    explicit SimpleKeyframeWidget(const Timecode &t, int duration, QWidget* parent = 0);
+    ~SimpleKeyframeWidget();
 
     int getPosition();
     void setKeyframes(const QList <int> &keyframes);
index 25dbde978f68bddabb88fe79dabed5b903de8409..4311145367293c7c924941e775f7100a868fbbf0 100644 (file)
@@ -27,7 +27,7 @@ class SimpleTimelineWidget : public QWidget
     Q_OBJECT
 
 public:
-    SimpleTimelineWidget(QWidget* parent = 0);
+    explicit SimpleTimelineWidget(QWidget* parent = 0);
     void setKeyframes(const QList <int>& keyframes);
     void setDuration(int dur);
 
index e601c814f2745ce6a68f126dac3d7cfd154a05d8..a00e4b1eb63820ced476327fa9e2de4ccbd970f7 100644 (file)
@@ -35,7 +35,7 @@ class ArchiveOrg : public AbstractService
 
 public:
     explicit ArchiveOrg(QListWidget *listWidget, QObject * parent = 0);
-    ~ArchiveOrg();
+    virtual ~ArchiveOrg();
     virtual QString getExtension(QListWidgetItem *item);
     virtual QString getDefaultDownloadName(QListWidgetItem *item);