Commit f4699aef authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

const'ref

parent 55b10ef4
......@@ -27,7 +27,7 @@ BPoint::BPoint() :
{
}
BPoint::BPoint(QPointF handle1, QPointF point, QPointF handle2) :
BPoint::BPoint(const QPointF &handle1, const QPointF &point, const QPointF &handle2) :
h1(handle1),
p(point),
h2(handle2)
......@@ -52,7 +52,7 @@ bool BPoint::operator==(const BPoint& point) const
point.h2 == h2;
}
void BPoint::setP(QPointF point, bool updateHandles)
void BPoint::setP(const QPointF &point, bool updateHandles)
{
QPointF offset = point - p;
p = point;
......@@ -62,7 +62,7 @@ void BPoint::setP(QPointF point, bool updateHandles)
}
}
void BPoint::setH1(QPointF handle1)
void BPoint::setH1(const QPointF &handle1)
{
h1 = handle1;
if (handlesLinked) {
......@@ -73,7 +73,7 @@ void BPoint::setH1(QPointF handle1)
}
}
void BPoint::setH2(QPointF handle2)
void BPoint::setH2(const QPointF &handle2)
{
h2 = handle2;
if (handlesLinked) {
......
......@@ -31,7 +31,7 @@ public:
/** @brief Sets the point to -1, -1 to mark it as unusable (until point + handles have proper values) */
BPoint();
/** @brief Sets up according to the params. Linking detecting is done using autoSetLinked(). */
BPoint(QPointF handle1, QPointF point, QPointF handle2);
BPoint(const QPointF &handle1, const QPointF &point, const QPointF &handle2);
/** @brief Returns h1 if i = 0, p if i = 1, h2 if i = 2. */
QPointF &operator[](int i);
......@@ -41,17 +41,17 @@ public:
/** @brief Sets p to @param point.
* @param updateHandles (default = true) Whether to make sure the handles keep their position relative to p. */
void setP(QPointF point, bool updateHandles = true);
void setP(const QPointF &point, bool updateHandles = true);
/** @brief Sets h1 to @param handle1.
*
* If handlesLinked is true h2 is updated. */
void setH1(QPointF handle1);
void setH1(const QPointF &handle1);
/** @brief Sets h2 to @param handle2.
*
* If handlesLinked is true h1 is updated. */
void setH2(QPointF handle2);
void setH2(const QPointF &handle2);
void keepInRange(qreal xMin, qreal xMax);
/** @brief Sets handlesLinked to true if the handles are in a linked state (line through h1, p, h2) otherwise to false. */
......
......@@ -21,7 +21,7 @@
#include <KLocale>
AddMarkerCommand::AddMarkerCommand(CustomTrackView *view, const CommentedTime oldMarker, const CommentedTime newMarker, const QString &id, QUndoCommand * parent) :
AddMarkerCommand::AddMarkerCommand(CustomTrackView *view, const CommentedTime &oldMarker, const CommentedTime &newMarker, const QString &id, QUndoCommand * parent) :
QUndoCommand(parent),
m_view(view),
m_oldMarker(oldMarker),
......
......@@ -32,7 +32,7 @@ class CustomTrackView;
class AddMarkerCommand : public QUndoCommand
{
public:
AddMarkerCommand(CustomTrackView *view, const CommentedTime oldMarker, const CommentedTime newMarker, const QString &id, QUndoCommand * parent = 0);
AddMarkerCommand(CustomTrackView *view, const CommentedTime &oldMarker, const CommentedTime &newMarker, const QString &id, QUndoCommand * parent = 0);
virtual void undo();
virtual void redo();
......
......@@ -23,7 +23,7 @@
#include <KLocale>
AddTrackCommand::AddTrackCommand(CustomTrackView *view, int ix, TrackInfo info, bool addTrack, QUndoCommand * parent) :
AddTrackCommand::AddTrackCommand(CustomTrackView *view, int ix, const TrackInfo &info, bool addTrack, QUndoCommand * parent) :
QUndoCommand(parent),
m_view(view),
m_ix(ix),
......
......@@ -33,7 +33,7 @@ class CustomTrackView;
class AddTrackCommand : public QUndoCommand
{
public:
AddTrackCommand(CustomTrackView *view, int ix, TrackInfo info, bool addTrack, QUndoCommand * parent = 0);
AddTrackCommand(CustomTrackView *view, int ix, const TrackInfo &info, bool addTrack, QUndoCommand * parent = 0);
virtual void undo();
virtual void redo();
......
......@@ -21,7 +21,7 @@
#include <KLocale>
AddTransitionCommand::AddTransitionCommand(CustomTrackView *view, ItemInfo info, int transitiontrack, const QDomElement &params, bool remove, bool doIt, QUndoCommand * parent) :
AddTransitionCommand::AddTransitionCommand(CustomTrackView *view, const ItemInfo &info, int transitiontrack, const QDomElement &params, bool remove, bool doIt, QUndoCommand * parent) :
QUndoCommand(parent),
m_view(view),
m_info(info),
......
......@@ -32,7 +32,7 @@ class CustomTrackView;
class AddTransitionCommand : public QUndoCommand
{
public:
AddTransitionCommand(CustomTrackView *view, ItemInfo info, int transitiontrack, const QDomElement &params, bool remove, bool doIt, QUndoCommand * parent = 0);
AddTransitionCommand(CustomTrackView *view, const ItemInfo &info, int transitiontrack, const QDomElement &params, bool remove, bool doIt, QUndoCommand * parent = 0);
virtual void undo();
virtual void redo();
......
......@@ -23,7 +23,7 @@
#include <KLocale>
ChangeEffectStateCommand::ChangeEffectStateCommand(CustomTrackView *view, const int track, GenTime pos, const QList <int>& effectIndexes, bool disable, bool refreshEffectStack, bool doIt, QUndoCommand *parent) :
ChangeEffectStateCommand::ChangeEffectStateCommand(CustomTrackView *view, const int track, const GenTime& pos, const QList <int>& effectIndexes, bool disable, bool refreshEffectStack, bool doIt, QUndoCommand *parent) :
QUndoCommand(parent),
m_view(view),
m_track(track),
......
......@@ -31,7 +31,7 @@ class CustomTrackView;
class ChangeEffectStateCommand : public QUndoCommand
{
public:
ChangeEffectStateCommand(CustomTrackView *view, const int track, GenTime pos, const QList <int>& effectIndexes, bool disable, bool refreshEffectStack, bool doIt, QUndoCommand *parent = 0);
ChangeEffectStateCommand(CustomTrackView *view, const int track, const GenTime &pos, const QList <int>& effectIndexes, bool disable, bool refreshEffectStack, bool doIt, QUndoCommand *parent = 0);
virtual void undo();
virtual void redo();
......
......@@ -23,7 +23,7 @@
#include <KLocale>
EditEffectCommand::EditEffectCommand(CustomTrackView *view, const int track, GenTime pos, const QDomElement &oldeffect, const QDomElement &effect, int stackPos, bool refreshEffectStack, bool doIt, QUndoCommand *parent) :
EditEffectCommand::EditEffectCommand(CustomTrackView *view, const int track, const GenTime &pos, const QDomElement &oldeffect, const QDomElement &effect, int stackPos, bool refreshEffectStack, bool doIt, QUndoCommand *parent) :
QUndoCommand(parent),
m_view(view),
m_track(track),
......
......@@ -31,7 +31,7 @@ class CustomTrackView;
class EditEffectCommand : public QUndoCommand
{
public:
EditEffectCommand(CustomTrackView *view, const int track, GenTime pos, const QDomElement &oldeffect, const QDomElement &effect, int stackPos, bool refreshEffectStack, bool doIt, QUndoCommand *parent = 0);
EditEffectCommand(CustomTrackView *view, const int track, const GenTime &pos, const QDomElement &oldeffect, const QDomElement &effect, int stackPos, bool refreshEffectStack, bool doIt, QUndoCommand *parent = 0);
virtual int id() const;
virtual bool mergeWith(const QUndoCommand * command);
......
......@@ -20,7 +20,7 @@
#include <KLocale>
EditTransitionCommand::EditTransitionCommand(CustomTrackView *view, const int track, GenTime pos, const QDomElement &oldeffect, const QDomElement &effect, bool doIt, QUndoCommand * parent) :
EditTransitionCommand::EditTransitionCommand(CustomTrackView *view, const int track, const GenTime &pos, const QDomElement &oldeffect, const QDomElement &effect, bool doIt, QUndoCommand * parent) :
QUndoCommand(parent),
m_view(view),
m_track(track),
......
......@@ -28,7 +28,7 @@ class CustomTrackView;
class EditTransitionCommand : public QUndoCommand
{
public:
EditTransitionCommand(CustomTrackView *view, const int track, GenTime pos, const QDomElement &oldeffect, const QDomElement &effect, bool doIt, QUndoCommand * parent = NULL);
EditTransitionCommand(CustomTrackView *view, const int track, const GenTime &pos, const QDomElement &oldeffect, const QDomElement &effect, bool doIt, QUndoCommand * parent = NULL);
virtual int id() const;
virtual bool mergeWith(const QUndoCommand * command);
......
......@@ -24,7 +24,7 @@
#include <KLocale>
MoveClipCommand::MoveClipCommand(CustomTrackView *view, const ItemInfo start, const ItemInfo end, bool doIt, QUndoCommand * parent) :
MoveClipCommand::MoveClipCommand(CustomTrackView *view, const ItemInfo &start, const ItemInfo &end, bool doIt, QUndoCommand * parent) :
QUndoCommand(parent),
m_view(view),
m_startPos(start),
......
......@@ -31,7 +31,7 @@ class CustomTrackView;
class MoveClipCommand : public QUndoCommand
{
public:
MoveClipCommand(CustomTrackView *view, const ItemInfo start, const ItemInfo end, bool doIt, QUndoCommand * parent = 0);
MoveClipCommand(CustomTrackView *view, const ItemInfo &start, const ItemInfo &end, bool doIt, QUndoCommand * parent = 0);
virtual void undo();
virtual void redo();
......
......@@ -23,7 +23,7 @@
#include <KLocale>
MoveEffectCommand::MoveEffectCommand(CustomTrackView *view, const int track, GenTime pos, const QList<int> &oldPos, int newPos, QUndoCommand * parent) :
MoveEffectCommand::MoveEffectCommand(CustomTrackView *view, const int track, const GenTime &pos, const QList<int> &oldPos, int newPos, QUndoCommand * parent) :
QUndoCommand(parent),
m_view(view),
m_track(track),
......
......@@ -31,7 +31,7 @@ class CustomTrackView;
class MoveEffectCommand : public QUndoCommand
{
public:
MoveEffectCommand(CustomTrackView *view, const int track, GenTime pos, const QList <int> &oldPos, int newPos, QUndoCommand * parent = 0);
MoveEffectCommand(CustomTrackView *view, const int track, const GenTime &pos, const QList <int> &oldPos, int newPos, QUndoCommand * parent = 0);
virtual int id() const;
virtual bool mergeWith(const QUndoCommand * command);
......
......@@ -20,7 +20,7 @@
#include <KLocale>
MoveTransitionCommand::MoveTransitionCommand(CustomTrackView *view, const ItemInfo start, const ItemInfo end, bool doIt, QUndoCommand * parent) :
MoveTransitionCommand::MoveTransitionCommand(CustomTrackView *view, const ItemInfo &start, const ItemInfo &end, bool doIt, QUndoCommand * parent) :
QUndoCommand(parent),
m_view(view),
m_startPos(start),
......
......@@ -27,7 +27,7 @@ class CustomTrackView;
class MoveTransitionCommand : public QUndoCommand
{
public:
MoveTransitionCommand(CustomTrackView *view, const ItemInfo start, const ItemInfo end, bool doIt, QUndoCommand * parent = 0);
MoveTransitionCommand(CustomTrackView *view, const ItemInfo &start, const ItemInfo &end, bool doIt, QUndoCommand * parent = 0);
virtual void undo();
virtual void redo();
......
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