Commit 9ee93449 authored by Vincent Pinon's avatar Vincent Pinon
Browse files

clang-tidy -fix: modernize-pass-by-value

parent 7ca22b50
......@@ -31,20 +31,21 @@
#include "audiolevelwidget.hpp"
#include "capture/mediacapture.h"
#include <klocalizedstring.h>
#include <KDualAction>
#include <QGridLayout>
#include <QToolButton>
#include <KSqueezedTextLabel>
#include <QCheckBox>
#include <QSlider>
#include <QDial>
#include <QSpinBox>
#include <QDoubleSpinBox>
#include <QFontDatabase>
#include <QGridLayout>
#include <QLabel>
#include <QMouseEvent>
#include <QSlider>
#include <QSpinBox>
#include <QStyle>
#include <QFontDatabase>
#include <KSqueezedTextLabel>
#include <QToolButton>
#include <klocalizedstring.h>
#include <utility>
static inline double IEC_Scale(double dB)
{
......@@ -100,7 +101,7 @@ void MixerWidget::property_changed( mlt_service , MixerWidget *widget, char *nam
}
}
MixerWidget::MixerWidget(int tid, std::shared_ptr<Mlt::Tractor> service, const QString &trackTag, const QString &trackName, MixerManager *parent)
MixerWidget::MixerWidget(int tid, std::shared_ptr<Mlt::Tractor> service, QString trackTag, const QString &trackName, MixerManager *parent)
: QWidget(parent)
, m_manager(parent)
, m_tid(tid)
......@@ -116,12 +117,12 @@ MixerWidget::MixerWidget(int tid, std::shared_ptr<Mlt::Tractor> service, const Q
, m_lastVolume(0)
, m_listener(nullptr)
, m_recording(false)
, m_trackTag(trackTag)
, m_trackTag(std::move(trackTag))
{
buildUI(service.get(), trackName);
}
MixerWidget::MixerWidget(int tid, Mlt::Tractor *service, const QString &trackTag, const QString &trackName, MixerManager *parent)
MixerWidget::MixerWidget(int tid, Mlt::Tractor *service, QString trackTag, const QString &trackName, MixerManager *parent)
: QWidget(parent)
, m_manager(parent)
, m_tid(tid)
......@@ -137,7 +138,7 @@ MixerWidget::MixerWidget(int tid, Mlt::Tractor *service, const QString &trackTag
, m_lastVolume(0)
, m_listener(nullptr)
, m_recording(false)
, m_trackTag(trackTag)
, m_trackTag(std::move(trackTag))
{
buildUI(service, trackName);
}
......
......@@ -51,8 +51,8 @@ class MixerWidget : public QWidget
Q_OBJECT
public:
MixerWidget(int tid, std::shared_ptr<Mlt::Tractor> service, const QString &trackTag, const QString &trackName, MixerManager *parent = nullptr);
MixerWidget(int tid, Mlt::Tractor *service, const QString &trackTag, const QString &trackName, MixerManager *parent = nullptr);
MixerWidget(int tid, std::shared_ptr<Mlt::Tractor> service, QString trackTag, const QString &trackName, MixerManager *parent = nullptr);
MixerWidget(int tid, Mlt::Tractor *service, QString trackTag, const QString &trackName, MixerManager *parent = nullptr);
~MixerWidget() override;
void buildUI(Mlt::Tractor *service, const QString &trackName);
/** @brief discard stored audio values and reset vu-meter to 0 if requested */
......
......@@ -35,15 +35,16 @@
#include <KLocalizedString>
#include <KMessageBox>
#include <QApplication>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QTextCodec>
#include <QApplication>
#include <utility>
SubtitleModel::SubtitleModel(Mlt::Tractor *tractor, std::shared_ptr<TimelineItemModel> timeline, QObject *parent)
: QAbstractListModel(parent)
, m_timeline(timeline)
, m_timeline(std::move(timeline))
, m_lock(QReadWriteLock::Recursive)
, m_subtitleFilter(new Mlt::Filter(pCore->getCurrentProfile()->profile(), "avfilter.subtitles"))
, m_tractor(tractor)
......
......@@ -21,6 +21,7 @@
#include <klocalizedstring.h>
#include <QColor>
#include <utility>
#ifdef CRASH_AUTO_TEST
#pragma GCC diagnostic push
......@@ -214,7 +215,7 @@ SubtitledTime::SubtitledTime()
SubtitledTime::SubtitledTime(const GenTime &start, QString sub, const GenTime &end)
: m_starttime(start)
, m_subtitle(sub)
, m_subtitle(std::move(sub))
, m_endtime(end)
{
}
......
......@@ -36,10 +36,11 @@
#include <QFontDatabase>
#include <QProcess>
#include <memory>
#include <utility>
SpeechDialog::SpeechDialog(const std::shared_ptr<TimelineItemModel> &timeline, QPoint zone, bool activeTrackOnly, bool selectionOnly, QWidget *parent)
SpeechDialog::SpeechDialog(std::shared_ptr<TimelineItemModel> timeline, QPoint zone, bool activeTrackOnly, bool selectionOnly, QWidget *parent)
: QDialog(parent)
, m_timeline(timeline)
, m_timeline(std::move(timeline))
{
setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
......
......@@ -40,7 +40,7 @@ class SpeechDialog : public QDialog, public Ui::SpeechDialog_UI
Q_OBJECT
public:
explicit SpeechDialog(const std::shared_ptr<TimelineItemModel> &timeline, QPoint zone, bool activeTrackOnly = false, bool selectionOnly = false, QWidget *parent = nullptr);
explicit SpeechDialog(std::shared_ptr<TimelineItemModel> timeline, QPoint zone, bool activeTrackOnly = false, bool selectionOnly = false, QWidget *parent = nullptr);
~SpeechDialog() override;
private:
......
......@@ -19,16 +19,18 @@
***************************************************************************/
#include "abstractclipjob.h"
#include "doc/kdenlivedoc.h"
#include "kdenlivesettings.h"
#include <utility>
AbstractClipJob::AbstractClipJob(JOBTYPE type, QString id, const ObjectId &owner, QObject *parent)
AbstractClipJob::AbstractClipJob(JOBTYPE type, QString id, ObjectId owner, QObject *parent)
: QObject(parent)
, m_clipId(std::move(id))
, m_jobType(type)
, m_inPoint(-1)
, m_outPoint(-1)
, m_owner(owner)
, m_owner(std::move(owner))
{
if (m_clipId.count(QStringLiteral("/")) == 2) {
m_inPoint = m_clipId.section(QLatin1Char('/'), 1, 1).toInt();
......
......@@ -53,7 +53,7 @@ public:
SPEEDJOB = 10,
CACHEJOB = 11
};
AbstractClipJob(JOBTYPE type, QString id, const ObjectId &owner, QObject *parent = nullptr);
AbstractClipJob(JOBTYPE type, QString id, ObjectId owner, QObject *parent = nullptr);
~AbstractClipJob() override;
template <typename T, typename... Args> static std::shared_ptr<T> make(const QString &binId, Args &&... args)
......
......@@ -39,6 +39,7 @@
#include <QApplication>
#include <QDialog>
#include <QPointer>
#include <utility>
CutClipJob::CutClipJob(const QString &binId, const QString sourcePath, GenTime inTime, GenTime outTime, const QString destPath, QStringList encodingParams)
: AbstractClipJob(CUTJOB, binId, {ObjectType::BinClip, binId.toInt()})
......@@ -48,7 +49,7 @@ CutClipJob::CutClipJob(const QString &binId, const QString sourcePath, GenTime i
, m_jobProcess(nullptr)
, m_in(inTime)
, m_out(outTime)
, m_encodingParams(encodingParams)
, m_encodingParams(std::move(encodingParams))
, m_jobDuration((int)(outTime - inTime).seconds())
{
}
......
......@@ -28,14 +28,15 @@
#include "macros.hpp"
#include <QThread>
#include <utility>
#include <klocalizedstring.h>
FilterClipJob::FilterClipJob(const QString &binId, const ObjectId &owner, std::weak_ptr<AssetParameterModel> model, const QString &assetId, int in, int out, const QString &filterName, std::unordered_map<QString, QVariant> filterParams, std::unordered_map<QString, QString> filterData, const QStringList consumerArgs)
FilterClipJob::FilterClipJob(const QString &binId, const ObjectId &owner, std::weak_ptr<AssetParameterModel> model, QString assetId, int in, int out, QString filterName, std::unordered_map<QString, QVariant> filterParams, std::unordered_map<QString, QString> filterData, const QStringList consumerArgs)
: MeltJob(binId, owner, FILTERCLIPJOB, false, in, out)
, m_model(model)
, m_filterName(filterName)
, m_assetId(assetId)
, m_model(std::move(model))
, m_filterName(std::move(filterName))
, m_assetId(std::move(assetId))
, m_filterParams(std::move(filterParams))
, m_filterData(std::move(filterData))
, m_consumerArgs(consumerArgs)
......
......@@ -33,7 +33,7 @@ class FilterClipJob : public MeltJob
Q_OBJECT
public:
FilterClipJob(const QString &binId, const ObjectId &owner, std::weak_ptr<AssetParameterModel> model, const QString &assetId, int in, int out, const QString &filterName, std::unordered_map<QString, QVariant> filterParams, std::unordered_map<QString, QString> filterData, const QStringList consumerArgs);
FilterClipJob(const QString &binId, const ObjectId &owner, std::weak_ptr<AssetParameterModel> model, QString assetId, int in, int out, QString filterName, std::unordered_map<QString, QVariant> filterParams, std::unordered_map<QString, QString> filterData, const QStringList consumerArgs);
const QString getDescription() const override;
/** @brief This is to be called after the job finished.
By design, the job should store the result of the computation but not share it with the rest of the code. This happens when we call commitResult */
......
......@@ -41,11 +41,12 @@
#include <QWidget>
#include <mlt++/MltProducer.h>
#include <mlt++/MltProfile.h>
#include <utility>
LoadJob::LoadJob(const QString &binId, const QDomElement &xml, const std::function<void()> &readyCallBack)
LoadJob::LoadJob(const QString &binId, const QDomElement &xml, std::function<void()> readyCallBack)
: AbstractClipJob(LOADJOB, binId, {ObjectType::BinClip, binId.toInt()})
, m_xml(xml)
, m_readyCallBack(readyCallBack)
, m_readyCallBack(std::move(readyCallBack))
{
}
......
......@@ -43,7 +43,7 @@ public:
@param frameNumber is the frame to extract. Leave to -1 for default
@param persistent: if true, we will use the persistent cache (for query and saving)
*/
LoadJob(const QString &binId, const QDomElement &xml, const std::function<void()> &readyCallBack = []() {});
LoadJob(const QString &binId, const QDomElement &xml, std::function<void()> readyCallBack = []() {});
const QString getDescription() const override;
......
......@@ -31,6 +31,7 @@
#include <QProcess>
#include <QThread>
#include <utility>
#include <klocalizedstring.h>
......@@ -40,7 +41,7 @@ TranscodeJob::TranscodeJob(const QString &binId, QString params)
, m_isFfmpegJob(true)
, m_jobProcess(nullptr)
, m_done(false)
, m_transcodeParams(params)
, m_transcodeParams(std::move(params))
{
}
......
......@@ -22,11 +22,12 @@
#include "kdenlivesettings.h"
#include <QIcon>
#include <utility>
TrackDialog::TrackDialog(const std::shared_ptr<TimelineItemModel> &model, int trackIndex, QWidget *parent, bool deleteMode, int activeTrackId)
TrackDialog::TrackDialog(std::shared_ptr<TimelineItemModel> model, int trackIndex, QWidget *parent, bool deleteMode, int activeTrackId)
: QDialog(parent)
, m_trackIndex(trackIndex)
, m_model(model)
, m_model(std::move(model))
, m_deleteMode(deleteMode)
, m_activeTrack(activeTrackId)
{
......
......@@ -28,7 +28,7 @@ class TrackDialog : public QDialog, public Ui::AddTrack_UI
Q_OBJECT
public:
explicit TrackDialog(const std::shared_ptr<TimelineItemModel> &model, int trackIndex = -1, QWidget *parent = nullptr, bool deleteMode = false, int activeTrack = -1);
explicit TrackDialog(std::shared_ptr<TimelineItemModel> model, int trackIndex = -1, QWidget *parent = nullptr, bool deleteMode = false, int activeTrack = -1);
/** @brief: returns the selected position in MLT
*/
int selectedTrackPosition() const;
......
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