]> git.sesse.net Git - kdenlive/commitdiff
const'ify/ref + minor optimization
authorMontel Laurent <montel@kde.org>
Thu, 16 May 2013 05:52:27 +0000 (07:52 +0200)
committerMontel Laurent <montel@kde.org>
Thu, 16 May 2013 05:52:27 +0000 (07:52 +0200)
src/colorpickerwidget.h
src/customruler.cpp
src/customruler.h
src/customtrackview.cpp
src/customtrackview.h

index 2401a2795d920efdd6b5f8810bffcf2100b7d1a9..def14f1f79f9b666a90130248456dd6a15eabcaf 100644 (file)
@@ -95,7 +95,7 @@ private slots:
     void slotGetAverageColor();
 
 signals:
-    void colorPicked(QColor);
+    void colorPicked(const QColor&);
     void displayMessage(const QString&, int);
     /** @brief When user wants to pick a color, it's better to disable filter so we get proper color values. */
     void disableCurrentFilter(bool);
index b7126ae0214c926c1f70d86a50e240f54cd7797c..08370c21e1a973ae3719142c5fb85391067d694e 100644 (file)
@@ -99,7 +99,7 @@ void CustomRuler::updatePalette()
     m_zoneColor.setAlpha(180);
 }
 
-void CustomRuler::updateProjectFps(Timecode t)
+void CustomRuler::updateProjectFps(const Timecode &t)
 {
     m_timecode = t;
     mediumMarkDistance = FRAME_SIZE * m_timecode.fps();
@@ -133,7 +133,7 @@ void CustomRuler::slotGoToGuide(QAction *act)
     m_view->initCursorPos(act->data().toInt());
 }
 
-void CustomRuler::setZone(QPoint p)
+void CustomRuler::setZone(const QPoint &p)
 {
     m_zoneStart = p.x();
     m_zoneEnd = p.y();
@@ -261,8 +261,8 @@ void CustomRuler::leaveEvent(QEvent * event)
 {
     QWidget::leaveEvent(event);
     if (m_cursorColor == palette().link()) {
-       m_cursorColor = palette().text();
-       update();
+        m_cursorColor = palette().text();
+        update();
     }
 }
 
@@ -288,8 +288,10 @@ int CustomRuler::outPoint() const
 
 void CustomRuler::slotMoveRuler(int newPos)
 {
-    m_offset = newPos;
-    update();
+    if (m_offset != newPos) {
+        m_offset = newPos;
+        update();
+    }
 }
 
 int CustomRuler::offset() const
index 1bebf0b3cd9b9f6e1e6513b87f921d03aaa67a54..33e006fa55cbb4c8c6a11bc8649752ad53a1fa1f 100644 (file)
@@ -45,9 +45,9 @@ public:
     int outPoint() const;
     int inPoint() const;
     void setDuration(int d);
-    void setZone(QPoint p);
+    void setZone(const QPoint &p);
     int offset() const;
-    void updateProjectFps(Timecode t);
+    void updateProjectFps(const Timecode &t);
     void updateFrameSize();
     void updatePalette();
     
index b0ff7ba2b11bcac1f04545bd562ab6b05087b179..0697c375a84a8b8080d6803a0e76bcd25d2e6c35 100644 (file)
@@ -288,7 +288,7 @@ void CustomTrackView::checkAutoScroll()
 }*/
 
 
-int CustomTrackView::getFrameWidth()
+int CustomTrackView::getFrameWidth() const
 {
     return (int) (m_tracksHeight * m_document->mltProfile().display_aspect_num / m_document->mltProfile().display_aspect_den + 0.5);
 }
@@ -1254,7 +1254,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
     m_blockRefresh = false;
 }
 
-void CustomTrackView::rebuildGroup(int childTrack, GenTime childPos)
+void CustomTrackView::rebuildGroup(int childTrack, const GenTime &childPos)
 {
     const QPointF p((int)childPos.frames(m_document->fps()), childTrack * m_tracksHeight + m_tracksHeight / 2);
     QList<QGraphicsItem *> list = scene()->items(p);
index 0242a2119bf21f8f5e72d3badfddf155360581f2..3dff40620ad8147aec4af5bbb21c36b8c215385b 100644 (file)
@@ -204,7 +204,7 @@ public:
     * Check whether given track has a clip with audio in it. */
     bool hasAudio(int track) const;
 
-    int getFrameWidth();
+    int getFrameWidth() const;
     /** @brief Returns last requested seeking pos (or SEEK_INACTIVE if no seek). */
     int seekPosition() const;
 
@@ -276,7 +276,7 @@ public slots:
     /** @brief Rebuilds a group to fit again after children changed.
     * @param childTrack the track of one of the groups children
     * @param childPos The position of the same child */
-    void rebuildGroup(int childTrack, GenTime childPos);
+    void rebuildGroup(int childTrack, const GenTime &childPos);
     /** @brief Rebuilds a group to fit again after children changed.
     * @param group The group to rebuild */
     void rebuildGroup(AbstractGroupItem *group);