Commit aa37ed1e authored by Laurent Montel's avatar Laurent Montel 😁

const'ify/ref + minor optimization

parent b1fa19fd
......@@ -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);
......
......@@ -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
......
......@@ -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();
......
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment