[Kdenlive-devel] [PATCH kdenlive 03/27] const parameters as reference
Mikko Rapeli
mikko.rapeli at iki.fi
Sun Aug 28 10:24:43 UTC 2011
Found by cppcheck.
---
src/customtrackview.cpp | 28 ++++++++++++++--------------
src/customtrackview.h | 30 +++++++++++++++---------------
2 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp
index 38ab4d6..04874a6 100644
--- a/src/customtrackview.cpp
+++ b/src/customtrackview.cpp
@@ -1371,7 +1371,7 @@ void CustomTrackView::editItemDuration()
}
}
-void CustomTrackView::editKeyFrame(const GenTime /*pos*/, const int /*track*/, const int /*index*/, const QString /*keyframes*/)
+void CustomTrackView::editKeyFrame(const GenTime & /*pos*/, const int /*track*/, const int /*index*/, const QString & /*keyframes*/)
{
/*ClipItem *clip = getClipItemAt((int)pos.frames(m_document->fps()), track);
if (clip) {
@@ -1456,7 +1456,7 @@ void CustomTrackView::insertClipCut(DocClipBase *clip, int in, int out)
splitAudio();
}
-bool CustomTrackView::insertDropClips(const QMimeData *data, const QPoint pos)
+bool CustomTrackView::insertDropClips(const QMimeData *data, const QPoint &pos)
{
if (data->hasFormat("kdenlive/clip")) {
m_clipDrag = true;
@@ -3045,7 +3045,7 @@ void CustomTrackView::slotInsertSpace()
}
}
-void CustomTrackView::insertSpace(QList<ItemInfo> clipsToMove, QList<ItemInfo> transToMove, int track, const GenTime duration, const GenTime offset)
+void CustomTrackView::insertSpace(QList<ItemInfo> clipsToMove, QList<ItemInfo> transToMove, int track, const GenTime &duration, const GenTime &offset)
{
int diff = duration.frames(m_document->fps());
resetSelectionGroup();
@@ -4270,7 +4270,7 @@ Transition *CustomTrackView::getTransitionItemAtStart(GenTime pos, int track)
return clip;
}
-void CustomTrackView::moveClip(const ItemInfo start, const ItemInfo end, bool refresh)
+void CustomTrackView::moveClip(const ItemInfo &start, const ItemInfo &end, bool refresh)
{
if (m_selectionGroup) resetSelectionGroup(false);
ClipItem *item = getClipItemAt((int) start.startPos.frames(m_document->fps()), start.track);
@@ -4313,7 +4313,7 @@ void CustomTrackView::moveClip(const ItemInfo start, const ItemInfo end, bool re
if (refresh) m_document->renderer()->doRefresh();
}
-void CustomTrackView::moveGroup(QList <ItemInfo> startClip, QList <ItemInfo> startTransition, const GenTime offset, const int trackOffset, bool reverseMove)
+void CustomTrackView::moveGroup(QList <ItemInfo> startClip, QList <ItemInfo> startTransition, const GenTime &offset, const int trackOffset, bool reverseMove)
{
// Group Items
resetSelectionGroup();
@@ -4431,7 +4431,7 @@ void CustomTrackView::moveGroup(QList <ItemInfo> startClip, QList <ItemInfo> sta
} else kDebug() << "///////// WARNING; NO GROUP TO MOVE";
}
-void CustomTrackView::moveTransition(const ItemInfo start, const ItemInfo end, bool m_refresh)
+void CustomTrackView::moveTransition(const ItemInfo &start, const ItemInfo &end, bool m_refresh)
{
Transition *item = getTransitionItemAt(start.startPos, start.track);
if (!item) {
@@ -4479,7 +4479,7 @@ void CustomTrackView::moveTransition(const ItemInfo start, const ItemInfo end, b
setDocumentModified();
}
-void CustomTrackView::resizeClip(const ItemInfo start, const ItemInfo end, bool dontWorry)
+void CustomTrackView::resizeClip(const ItemInfo &start, const ItemInfo &end, bool dontWorry)
{
bool resizeClipStart = (start.startPos != end.startPos);
ClipItem *item = getClipItemAtStart(start.startPos, start.track);
@@ -4983,7 +4983,7 @@ void CustomTrackView::slotDeleteAllClipMarkers(const QString &id)
m_commandStack->push(deleteMarkers);
}
-void CustomTrackView::addMarker(const QString &id, const GenTime &pos, const QString comment)
+void CustomTrackView::addMarker(const QString &id, const GenTime &pos, const QString &comment)
{
DocClipBase *base = m_document->clipManager()->getClipById(id);
if (!comment.isEmpty()) base->addSnapMarker(pos, comment);
@@ -5015,7 +5015,7 @@ void CustomTrackView::buildGuidesMenu(QMenu *goMenu) const
goMenu->setEnabled(!m_guides.isEmpty());
}
-void CustomTrackView::editGuide(const GenTime oldPos, const GenTime pos, const QString &comment)
+void CustomTrackView::editGuide(const GenTime &oldPos, const GenTime &pos, const QString &comment)
{
if (oldPos > GenTime() && pos > GenTime()) {
// move guide
@@ -5043,7 +5043,7 @@ void CustomTrackView::editGuide(const GenTime oldPos, const GenTime pos, const Q
m_document->syncGuides(m_guides);
}
-bool CustomTrackView::addGuide(const GenTime pos, const QString &comment)
+bool CustomTrackView::addGuide(const GenTime &pos, const QString &comment)
{
for (int i = 0; i < m_guides.count(); i++) {
if (m_guides.at(i)->position() == pos) {
@@ -5833,7 +5833,7 @@ void CustomTrackView::autoTransition()
setDocumentModified();
}
-void CustomTrackView::clipNameChanged(const QString id, const QString name)
+void CustomTrackView::clipNameChanged(const QString &id, const QString &name)
{
QList<QGraphicsItem *> list = scene()->items();
ClipItem *clip = NULL;
@@ -5880,7 +5880,7 @@ void CustomTrackView::getTransitionAvailableSpace(AbstractClipItem *item, GenTim
}
}
-void CustomTrackView::loadGroups(const QDomNodeList groups)
+void CustomTrackView::loadGroups(const QDomNodeList &groups)
{
for (int i = 0; i < groups.count(); i++) {
QDomNodeList children = groups.at(i).childNodes();
@@ -6554,7 +6554,7 @@ bool CustomTrackView::hasAudio(int track) const
return false;
}
-void CustomTrackView::slotAddTrackEffect(const QDomElement effect, int ix)
+void CustomTrackView::slotAddTrackEffect(const QDomElement &effect, int ix)
{
AddEffectCommand *command = new AddEffectCommand(this, m_document->tracksCount() - ix, GenTime(-1), effect, true);
m_commandStack->push(command);
@@ -6562,7 +6562,7 @@ void CustomTrackView::slotAddTrackEffect(const QDomElement effect, int ix)
}
-EffectsParameterList CustomTrackView::getEffectArgs(const QDomElement effect)
+EffectsParameterList CustomTrackView::getEffectArgs(const QDomElement &effect)
{
EffectsParameterList parameters;
QLocale locale;
diff --git a/src/customtrackview.h b/src/customtrackview.h
index 70c89e7..dbde9f8 100644
--- a/src/customtrackview.h
+++ b/src/customtrackview.h
@@ -60,16 +60,16 @@ public:
void configTracks(QList <TrackInfo> trackInfos);
int cursorPos();
void checkAutoScroll();
- void moveClip(const ItemInfo start, const ItemInfo end, bool refresh);
- void moveGroup(QList <ItemInfo> startClip, QList <ItemInfo> startTransition, const GenTime offset, const int trackOffset, bool reverseMove = false);
+ void moveClip(const ItemInfo &start, const ItemInfo &end, bool refresh);
+ void moveGroup(QList <ItemInfo> startClip, QList <ItemInfo> startTransition, const GenTime &offset, const int trackOffset, bool reverseMove = false);
/** move transition, startPos = (old start, old end), endPos = (new start, new end) */
- void moveTransition(const ItemInfo start, const ItemInfo end, bool m_refresh);
- void resizeClip(const ItemInfo start, const ItemInfo end, bool dontWorry = false);
+ void moveTransition(const ItemInfo &start, const ItemInfo &end, bool m_refresh);
+ void resizeClip(const ItemInfo &start, const ItemInfo &end, bool dontWorry = false);
void addClip(QDomElement xml, const QString &clipId, ItemInfo info, EffectsList list = EffectsList(), bool overwrite = false, bool push = false, bool refresh = true);
void deleteClip(ItemInfo info, bool refresh = true);
void slotDeleteClipMarker(const QString &comment, const QString &id, const GenTime &position);
void slotDeleteAllClipMarkers(const QString &id);
- void addMarker(const QString &id, const GenTime &pos, const QString comment);
+ void addMarker(const QString &id, const GenTime &pos, const QString &comment);
void setScale(double scaleFactor, double verticalScale);
void deleteClip(const QString &clipId);
void slotAddEffect(QDomElement effect, GenTime pos, int track);
@@ -95,7 +95,7 @@ public:
void slotSeekToPreviousSnap();
void slotSeekToNextSnap();
double getSnapPointForPos(double pos);
- void editKeyFrame(const GenTime pos, const int track, const int index, const QString keyframes);
+ void editKeyFrame(const GenTime &pos, const int track, const int index, const QString &keyframes);
bool findString(const QString &text);
void selectFound(QString track, QString pos);
bool findNextString(const QString &text);
@@ -117,7 +117,7 @@ public:
void slotInsertSpace();
/** @brief Prepares removing space. */
void slotRemoveSpace();
- void insertSpace(QList<ItemInfo> clipsToMove, QList<ItemInfo> transToMove, int track, const GenTime duration, const GenTime offset);
+ void insertSpace(QList<ItemInfo> clipsToMove, QList<ItemInfo> transToMove, int track, const GenTime &duration, const GenTime &offset);
ClipItem *getActiveClipUnderCursor(bool allowOutsideCursor = false) const;
void deleteTimelineTrack(int ix, TrackInfo trackinfo);
void saveThumbnails();
@@ -133,7 +133,7 @@ public:
void lockTrack(int ix, bool lock, bool requestUpdate = true);
void groupClips(bool group = true);
void doGroupClips(QList <ItemInfo> clipInfos, QList <ItemInfo> transitionInfos, bool group);
- void loadGroups(const QDomNodeList groups);
+ void loadGroups(const QDomNodeList &groups);
/** @brief Creates SplitAudioCommands for selected clips. */
void splitAudio();
@@ -209,7 +209,7 @@ public slots:
* @param t Position of the marker
* @param c Comment of the marker */
void slotAddClipMarker(const QString &id, GenTime t, QString c);
- bool addGuide(const GenTime pos, const QString &comment);
+ bool addGuide(const GenTime &pos, const QString &comment);
/** @brief Shows a dialog for adding a guide.
* @param dialog (default = true) false = do not show the dialog but use current position as position and comment */
@@ -218,7 +218,7 @@ public slots:
void slotEditGuide(int guidePos = -1);
void slotDeleteGuide(int guidePos = -1);
void slotDeleteAllGuides();
- void editGuide(const GenTime oldPos, const GenTime pos, const QString &comment);
+ void editGuide(const GenTime &oldPos, const GenTime &pos, const QString &comment);
void copyClip();
void pasteClip();
void pasteClipEffects();
@@ -231,7 +231,7 @@ public slots:
void slotDeleteTrack(int ix);
/** @brief Shows the configure tracks dialog. */
void slotConfigTracks(int ix);
- void clipNameChanged(const QString id, const QString name);
+ void clipNameChanged(const QString &id, const QString &name);
void slotTrackUp();
void slotTrackDown();
void slotSelectTrack(int ix);
@@ -259,7 +259,7 @@ public slots:
/** @brief Add en effect to a track.
* @param effect The new effect xml
* @param ix The track index */
- void slotAddTrackEffect(const QDomElement effect, int ix);
+ void slotAddTrackEffect(const QDomElement &effect, int ix);
/** @brief Update the list of snap points (sticky timeline hotspots).
* @param selected The currently selected clip if any
@@ -357,7 +357,7 @@ private:
/** Get the index of the video track that is just below current track */
int getPreviousVideoTrack(int track);
void updatePositionEffects(ClipItem * item, ItemInfo info, bool standalone = true);
- bool insertDropClips(const QMimeData *data, const QPoint pos);
+ bool insertDropClips(const QMimeData *data, const QPoint &pos);
bool canBePastedTo(QList <ItemInfo> infoList, int type) const;
bool canBePasted(QList<AbstractClipItem *> items, GenTime offset, int trackOffset) const;
bool canBeMoved(QList<AbstractClipItem *> items, GenTime offset, int trackOffset) const;
@@ -410,7 +410,7 @@ private:
void razorGroup(AbstractGroupItem *group, GenTime cutPos);
/** @brief Gets the effect parameters that will be passed to Mlt. */
- EffectsParameterList getEffectArgs(const QDomElement effect);
+ EffectsParameterList getEffectArgs(const QDomElement &effect);
/** @brief Update Tracknames to fit again after track was added/deleted.
* @param track Number of track which was added/deleted
@@ -464,7 +464,7 @@ signals:
void activateDocumentMonitor();
void trackHeightChanged();
void tracksChanged();
- void displayMessage(const QString, MessageType);
+ void displayMessage(const QString &, MessageType);
void showClipFrame(DocClipBase *, QPoint, const int);
void doTrackLock(int, bool);
void updateClipMarkers(DocClipBase *);
--
1.7.5.4
More information about the Kdenlive
mailing list