Commit 13b2d9d2 authored by Laurent Montel's avatar Laurent Montel 😁

Use const'ref

parent f3cc628a
......@@ -695,7 +695,7 @@ Monitor *Bin::monitor()
return m_monitor;
}
const QStringList Bin::getFolderInfo(QModelIndex selectedIx)
const QStringList Bin::getFolderInfo(const QModelIndex &selectedIx)
{
QStringList folderInfo;
QModelIndexList indexes;
......
......@@ -530,7 +530,7 @@ public:
/** @brief Return a list of all clips hashes used in this project */
QStringList getProxyHashList();
/** @brief Get info (id, name) of a folder (or the currently selected one) */
const QStringList getFolderInfo(QModelIndex selectedIx = QModelIndex());
const QStringList getFolderInfo(const QModelIndex &selectedIx = QModelIndex());
/** @brief Save a clip zone as MLT playlist */
void saveZone(QStringList info, QDir dir);
......
......@@ -219,26 +219,26 @@ QColor CommentedTime::markerColor(int type) {
}
}
bool CommentedTime::operator>(CommentedTime op) const {
bool CommentedTime::operator>(const CommentedTime &op) const {
return t > op.time();
}
bool CommentedTime::operator<(CommentedTime op) const {
bool CommentedTime::operator<(const CommentedTime &op) const {
return t < op.time();
}
bool CommentedTime::operator>=(CommentedTime op) const {
bool CommentedTime::operator>=(const CommentedTime &op) const {
return t >= op.time();
}
bool CommentedTime::operator<=(CommentedTime op) const {
bool CommentedTime::operator<=(const CommentedTime &op) const {
return t <= op.time();
}
bool CommentedTime::operator==(CommentedTime op) const {
bool CommentedTime::operator==(const CommentedTime &op) const {
return t == op.time();
}
bool CommentedTime::operator!=(CommentedTime op) const {
bool CommentedTime::operator!=(const CommentedTime &op) const {
return t != op.time();
}
......@@ -316,17 +316,17 @@ public:
static QColor markerColor(int type);
/* Implementation of > operator; Works identically as with basic types. */
bool operator>(CommentedTime op) const;
bool operator>(const CommentedTime &op) const;
/* Implementation of < operator; Works identically as with basic types. */
bool operator<(CommentedTime op) const;
bool operator<(const CommentedTime &op) const;
/* Implementation of >= operator; Works identically as with basic types. */
bool operator>=(CommentedTime op) const;
bool operator>=(const CommentedTime &op) const;
/* Implementation of <= operator; Works identically as with basic types. */
bool operator<=(CommentedTime op) const;
bool operator<=(const CommentedTime &op) const;
/* Implementation of == operator; Works identically as with basic types. */
bool operator==(CommentedTime op) const;
bool operator==(const CommentedTime &op) const;
/* Implementation of != operator; Works identically as with basic types. */
bool operator!=(CommentedTime op) const;
bool operator!=(const CommentedTime &op) const;
private:
GenTime t;
......
......@@ -38,7 +38,7 @@
#include "effectstack/positionedit.h"
#include "timeline/keyframeview.h"
KeyframeImport::KeyframeImport(ItemInfo srcInfo, ItemInfo dstInfo, QMap<QString, QString> data, const Timecode &tc, QDomElement xml, ProfileInfo profile, QWidget *parent) :
KeyframeImport::KeyframeImport(const ItemInfo &srcInfo, const ItemInfo &dstInfo, const QMap<QString, QString> &data, const Timecode &tc, const QDomElement &xml, const ProfileInfo &profile, QWidget *parent) :
QDialog(parent)
, m_xml(xml)
, m_profile(profile)
......
......@@ -38,7 +38,7 @@ class KeyframeImport : public QDialog
{
Q_OBJECT
public:
explicit KeyframeImport(ItemInfo srcInfo, ItemInfo dstInfo, QMap<QString, QString> data, const Timecode &tc, QDomElement xml, ProfileInfo profile, QWidget *parent = Q_NULLPTR);
explicit KeyframeImport(const ItemInfo &srcInfo, const ItemInfo &dstInfo, const QMap<QString, QString> &data, const Timecode &tc, const QDomElement &xml, const ProfileInfo &profile, QWidget *parent = Q_NULLPTR);
virtual ~KeyframeImport();
QString selectedData() const;
QString selectedTarget() const;
......
......@@ -475,7 +475,7 @@ void BinController::updateTrackProducer(const QString &id)
emit updateTimelineProducer(id);
}
void BinController::checkThumbnails(const QDir thumbFolder)
void BinController::checkThumbnails(const QDir &thumbFolder)
{
// Parse all controllers and load thumbnails
QMapIterator<QString, ClipController *> i(m_clipList);
......@@ -526,7 +526,7 @@ void BinController::checkAudioThumbs()
}
}
void BinController::saveDocumentProperties(const QMap <QString, QString> props, const QMap <QString, QString> metadata, const QMap <double, QString> guidesData)
void BinController::saveDocumentProperties(const QMap <QString, QString> &props, const QMap <QString, QString> &metadata, const QMap <double, QString> &guidesData)
{
// Clear previous properites
Mlt::Properties playlistProps(m_binPlaylist->get_properties());
......
......@@ -145,13 +145,13 @@ public:
Mlt::Repository *mltRepository();
/** @brief Load thumbnails for all producers */
void checkThumbnails(const QDir thumbFolder);
void checkThumbnails(const QDir &thumbFolder);
/** @brief Request audio thumbnails for all producers */
void checkAudioThumbs();
/** @brief Save document properties in MLT's bin playlist */
void saveDocumentProperties(const QMap <QString, QString> props, const QMap <QString, QString> metadata, const QMap <double, QString> guidesData);
void saveDocumentProperties(const QMap<QString, QString> &props, const QMap<QString, QString> &metadata, const QMap<double, QString> &guidesData);
/** @brief Save a property to main bin */
void saveProperty(const QString &name, const QString & value);
......
......@@ -577,7 +577,7 @@ const QString Render::sceneList(const QString root)
return playlist;
}
void Render::saveZone(const QString projectFolder, QPoint zone)
void Render::saveZone(const QString &projectFolder, QPoint zone)
{
QString clipFolder = KRecentDirs::dir(QStringLiteral(":KdenliveClipFolder"));
if (clipFolder.isEmpty()) {
......@@ -1259,7 +1259,7 @@ void Render::mltInsertSpace(QMap <int, int> trackClipStartList, QMap <int, int>
m_mltConsumer->set("refresh", 1);
}
bool Render::mltResizeClipCrop(ItemInfo info, GenTime newCropStart)
bool Render::mltResizeClipCrop(const ItemInfo &info, GenTime newCropStart)
{
Mlt::Service service(m_mltProducer->parent().get_service());
int newCropFrame = (int) newCropStart.frames(m_fps);
......
......@@ -193,7 +193,7 @@ class Render: public AbstractRender
Mlt::Producer *getSlowmotionProducer(const QString &url);
void mltInsertSpace(QMap <int, int> trackClipStartList, QMap <int, int> trackTransitionStartList, int track, const GenTime &duration, const GenTime &timeOffset);
int mltGetSpaceLength(const GenTime &pos, int track, bool fromBlankStart);
bool mltResizeClipCrop(ItemInfo info, GenTime newCropStart);
bool mltResizeClipCrop(const ItemInfo &info, GenTime newCropStart);
QList <TransitionInfo> mltInsertTrack(int ix, const QString &name, bool videoTrack);
......@@ -368,7 +368,7 @@ public slots:
void doRefresh();
/** @brief Save a part of current timeline to an xml file. */
void saveZone(const QString projectFolder, QPoint zone);
void saveZone(const QString &projectFolder, QPoint zone);
/** @brief Renderer moved to a new frame, check seeking */
bool checkFrameNumber(int pos);
......
......@@ -5147,7 +5147,7 @@ void CustomTrackView::resizeClip(const ItemInfo &start, const ItemInfo &end, boo
KdenliveSettings::setSnaptopoints(snap);
}
void CustomTrackView::prepareResizeClipStart(AbstractClipItem* item, ItemInfo oldInfo, int pos, bool check, QUndoCommand *command)
void CustomTrackView::prepareResizeClipStart(AbstractClipItem* item, const ItemInfo &oldInfo, int pos, bool check, QUndoCommand *command)
{
if (pos == oldInfo.startPos.frames(m_document->fps()))
return;
......@@ -7712,7 +7712,7 @@ bool CustomTrackView::hasAudio(int track) const
return false;
}
void CustomTrackView::slotAddTrackEffect(QDomElement effect, int ix)
void CustomTrackView::slotAddTrackEffect(const QDomElement &effect, int ix)
{
EffectsController::initTrackEffect(m_document->getProfileInfo(), effect);
QUndoCommand *effectCommand = new QUndoCommand();
......
......@@ -284,7 +284,7 @@ public:
* @param pos New startPos
* @param check (optional, default = false) Whether to check for collisions
* @param command (optional) Will be used as parent command (for undo history) */
void prepareResizeClipStart(AbstractClipItem *item, ItemInfo oldInfo, int pos, bool check = false, QUndoCommand *command = Q_NULLPTR);
void prepareResizeClipStart(AbstractClipItem *item, const ItemInfo &oldInfo, int pos, bool check = false, QUndoCommand *command = Q_NULLPTR);
/** @brief Takes care of updating effects and attached transitions during a resize from end.
* @param item Item to resize
......@@ -388,7 +388,7 @@ public slots:
/** @brief Add en effect to a track.
* @param effect The new effect xml
* @param ix The track index */
void slotAddTrackEffect(QDomElement effect, int ix);
void slotAddTrackEffect(const QDomElement &effect, int ix);
/** @brief Select all clips in selected track. */
void slotSelectClipsInTrack();
/** @brief Select all clips in timeline. */
......
......@@ -225,7 +225,7 @@ void TransitionHandler::cloneProperties(Mlt::Properties &dest, Mlt::Properties &
}
}
void TransitionHandler::updateTransition(QString oldTag, QString tag, int a_track, int b_track, GenTime in, GenTime out, QDomElement xml, bool force)
void TransitionHandler::updateTransition(const QString &oldTag, const QString &tag, int a_track, int b_track, GenTime in, GenTime out, const QDomElement &xml, bool force)
{
if (oldTag == tag && !force) updateTransitionParams(tag, a_track, b_track, in, out, xml);
else {
......
......@@ -42,7 +42,7 @@ public:
void plantTransition(Mlt::Transition &tr, int a_track, int b_track);
void plantTransition(Mlt::Field *field, Mlt::Transition &tr, int a_track, int b_track);
void cloneProperties(Mlt::Properties &dest, Mlt::Properties &source);
void updateTransition(QString oldTag, QString tag, int a_track, int b_track, GenTime in, GenTime out, QDomElement xml, bool force = false);
void updateTransition(const QString &oldTag, const QString &tag, int a_track, int b_track, GenTime in, GenTime out, const QDomElement &xml, bool force = false);
void updateTransitionParams(QString type, int a_track, int b_track, GenTime in, GenTime out, QDomElement xml);
bool deleteTransition(QString tag, int a_track, int b_track, GenTime in, GenTime out, QDomElement xml, bool refresh = true);
void deleteTrackTransitions(int ix);
......
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