Commit ee71e5c1 authored by Nicolas Carion's avatar Nicolas Carion
Browse files

clang-tidy performance

parent 861bd2ce
......@@ -384,6 +384,7 @@ void fuzz(const std::string &input)
if (valid) {
// std::cout << "VALID!!!" << std::endl;
std::vector<rttr::argument> args;
args.reserve(arguments.size());
for (const auto &a : arguments) {
args.emplace_back(a);
// std::cout<<"argument="<<a.get_type().get_name().to_string()<<std::endl;
......
......@@ -76,7 +76,7 @@ int main(int argc, char **argv)
if (!prod.is_valid()) {
fprintf(stderr, "INVALID playlist: %s \n", playlist.toUtf8().constData());
}
for (const QString frame : chunks) {
for (const QString &frame : chunks) {
fprintf(stderr, "START:%d \n", frame.toInt());
QString fileName = QStringLiteral("%1.%2").arg(frame).arg(extension);
if (baseFolder.exists(fileName)) {
......
......@@ -168,7 +168,7 @@ void AbstractTreeModel::notifyRowAppended(const std::shared_ptr<TreeItem> &row)
void AbstractTreeModel::notifyRowAboutToDelete(std::shared_ptr<TreeItem> item, int row)
{
auto index = getIndexFromItem(std::move(item));
auto index = getIndexFromItem(item);
beginRemoveRows(index, row, row);
}
......@@ -275,7 +275,7 @@ bool AbstractTreeModel::checkConsistency()
return true;
}
Fun AbstractTreeModel::addItem_lambda(std::shared_ptr<TreeItem> new_item, int parentId)
Fun AbstractTreeModel::addItem_lambda(const std::shared_ptr<TreeItem> &new_item, int parentId)
{
return [this, new_item, parentId]() {
/* Insertion is simply setting the parent of the item.*/
......
......@@ -70,7 +70,7 @@ public:
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
/* @brief Helper function to generate a lambda that adds an item to the tree */
Fun addItem_lambda(std::shared_ptr<TreeItem> new_item, int parentId);
Fun addItem_lambda(const std::shared_ptr<TreeItem> &new_item, int parentId);
/* @brief Helper function to generate a lambda that removes an item from the tree */
Fun removeItem_lambda(int id);
......
......@@ -37,7 +37,7 @@ TreeItem::TreeItem(const QList<QVariant> &data, const std::shared_ptr<AbstractTr
std::shared_ptr<TreeItem> TreeItem::construct(const QList<QVariant> &data, std::shared_ptr<AbstractTreeModel> model, bool isRoot, int id)
{
std::shared_ptr<TreeItem> self(new TreeItem(data, std::move(model), isRoot, id));
std::shared_ptr<TreeItem> self(new TreeItem(data, model, isRoot, id));
baseFinishConstruct(self);
return self;
}
......@@ -67,7 +67,7 @@ std::shared_ptr<TreeItem> TreeItem::appendChild(const QList<QVariant> &data)
return std::shared_ptr<TreeItem>();
}
bool TreeItem::appendChild(std::shared_ptr<TreeItem> child)
bool TreeItem::appendChild(const std::shared_ptr<TreeItem> &child)
{
if (hasAncestor(child->getId())) {
// in that case, we are trying to create a cycle, abort
......@@ -98,7 +98,7 @@ bool TreeItem::appendChild(std::shared_ptr<TreeItem> child)
return false;
}
void TreeItem::moveChild(int ix, std::shared_ptr<TreeItem> child)
void TreeItem::moveChild(int ix, const std::shared_ptr<TreeItem> &child)
{
if (auto ptr = m_model.lock()) {
auto parentPtr = child->m_parentItem.lock();
......@@ -190,7 +190,7 @@ QVariant TreeItem::dataColumn(int column) const
return m_itemData.value(column);
}
void TreeItem::setData(int column, const QVariant dataColumn)
void TreeItem::setData(int column, const QVariant &dataColumn)
{
m_itemData[column] = dataColumn;
}
......@@ -225,7 +225,7 @@ bool TreeItem::isInModel() const
return m_isInModel;
}
void TreeItem::registerSelf(std::shared_ptr<TreeItem> self)
void TreeItem::registerSelf(const std::shared_ptr<TreeItem> &self)
{
for (const auto &child : self->m_childItems) {
registerSelf(child);
......
......@@ -74,8 +74,8 @@ public:
Useful for example if the child should be a subclass of TreeItem
@return true on success. Otherwise, nothing is modified.
*/
bool appendChild(std::shared_ptr<TreeItem> child);
void moveChild(int ix, std::shared_ptr<TreeItem> child);
bool appendChild(const std::shared_ptr<TreeItem> &child);
void moveChild(int ix, const std::shared_ptr<TreeItem> &child);
/* @brief Remove given child from children list. The parent of the child is updated
accordingly
......@@ -104,7 +104,7 @@ public:
@param column Index of the column to look-up
*/
QVariant dataColumn(int column) const;
void setData(int column, const QVariant dataColumn);
void setData(int column, const QVariant &dataColumn);
/* @brief Return the index of current item amongst father's children
Returns -1 on error (eg: no parent set)
......@@ -146,7 +146,7 @@ protected:
static void baseFinishConstruct(const std::shared_ptr<TreeItem> &self);
/* @brief Helper functions to handle registration / deregistration to the model */
static void registerSelf(std::shared_ptr<TreeItem> self);
static void registerSelf(const std::shared_ptr<TreeItem> &self);
void deregisterSelf();
/* @brief Reflect update of the parent ptr (for example set the correct depth)
......
......@@ -86,7 +86,7 @@ bool AssetFilter::isVisible(const QModelIndex &sourceIndex)
bool AssetFilter::applyAll(std::shared_ptr<TreeItem> item) const
{
return filterName(std::move(item));
return filterName(item);
}
QModelIndex AssetFilter::getNextChild(const QModelIndex &current)
......
......@@ -122,7 +122,7 @@ AssetPanel::AssetPanel(QWidget *parent)
connect(m_effectStackWidget, &EffectStackView::updateEnabledState, [this]() { m_enableStackButton->setActive(m_effectStackWidget->isStackEnabled()); });
}
void AssetPanel::showTransition(int tid, std::shared_ptr<AssetParameterModel> transitionModel)
void AssetPanel::showTransition(int tid, const std::shared_ptr<AssetParameterModel> &transitionModel)
{
Q_UNUSED(tid)
ObjectId id = transitionModel->getOwnerId();
......@@ -140,7 +140,7 @@ void AssetPanel::showTransition(int tid, std::shared_ptr<AssetParameterModel> tr
m_transitionWidget->setModel(transitionModel, QSize(), true);
}
void AssetPanel::showEffectStack(const QString &itemName, std::shared_ptr<EffectStackModel> effectsModel, QSize frameSize, bool showKeyframes)
void AssetPanel::showEffectStack(const QString &itemName, const std::shared_ptr<EffectStackModel> &effectsModel, QSize frameSize, bool showKeyframes)
{
m_splitButton->setActive(false);
if (effectsModel == nullptr) {
......
......@@ -51,10 +51,10 @@ public:
AssetPanel(QWidget *parent);
/* @brief Shows the parameters of the given transition model */
void showTransition(int tid, std::shared_ptr<AssetParameterModel> transition_model);
void showTransition(int tid, const std::shared_ptr<AssetParameterModel> &transition_model);
/* @brief Shows the parameters of the given effect stack model */
void showEffectStack(const QString &itemName, std::shared_ptr<EffectStackModel> effectsModel, QSize frameSize, bool showKeyframes);
void showEffectStack(const QString &itemName, const std::shared_ptr<EffectStackModel> &effectsModel, QSize frameSize, bool showKeyframes);
/* @brief Clear the panel so that it doesn't display anything */
void clear();
......
......@@ -27,9 +27,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "monitor/monitor.h"
#include <QSize>
#include <utility>
CornersHelper::CornersHelper(Monitor *monitor, std::shared_ptr<AssetParameterModel> model, QPersistentModelIndex index, QObject *parent)
: KeyframeMonitorHelper(monitor, model, index, parent)
: KeyframeMonitorHelper(monitor, std::move(model), std::move(index), parent)
{
}
......
......@@ -30,6 +30,7 @@
#include <QDebug>
#include <QJsonDocument>
#include <mlt++/Mlt.h>
#include <utility>
KeyframeModel::KeyframeModel(std::weak_ptr<AssetParameterModel> model, const QModelIndex &index, std::weak_ptr<DocUndoStack> undo_stack, QObject *parent)
: QAbstractListModel(parent)
......@@ -122,7 +123,7 @@ bool KeyframeModel::addKeyframe(GenTime pos, KeyframeType type, QVariant value)
Fun redo = []() { return true; };
bool update = (m_keyframeList.count(pos) > 0);
bool res = addKeyframe(pos, type, value, true, undo, redo);
bool res = addKeyframe(pos, type, std::move(value), true, undo, redo);
if (res) {
PUSH_UNDO(undo, redo, update ? i18n("Change keyframe type") : i18n("Add keyframe"));
}
......@@ -290,7 +291,7 @@ bool KeyframeModel::moveKeyframe(int oldPos, int pos, QVariant newVal)
{
GenTime oPos(oldPos, pCore->getCurrentFps());
GenTime nPos(pos, pCore->getCurrentFps());
return moveKeyframe(oPos, nPos, newVal, true);
return moveKeyframe(oPos, nPos, std::move(newVal), true);
}
bool KeyframeModel::moveKeyframe(GenTime oldPos, GenTime pos, QVariant newVal, bool logUndo)
......@@ -300,7 +301,7 @@ bool KeyframeModel::moveKeyframe(GenTime oldPos, GenTime pos, QVariant newVal, b
if (oldPos == pos) return true;
Fun undo = []() { return true; };
Fun redo = []() { return true; };
bool res = moveKeyframe(oldPos, pos, newVal, undo, redo);
bool res = moveKeyframe(oldPos, pos, std::move(newVal), undo, redo);
if (res && logUndo) {
PUSH_UNDO(undo, redo, i18n("Move keyframe"));
}
......@@ -312,11 +313,11 @@ bool KeyframeModel::directUpdateKeyframe(GenTime pos, QVariant value)
QWriteLocker locker(&m_lock);
Q_ASSERT(m_keyframeList.count(pos) > 0);
KeyframeType type = m_keyframeList[pos].first;
auto operation = updateKeyframe_lambda(pos, type, value, true);
auto operation = updateKeyframe_lambda(pos, type, std::move(value), true);
return operation();
}
bool KeyframeModel::updateKeyframe(GenTime pos, QVariant value, Fun &undo, Fun &redo, bool update)
bool KeyframeModel::updateKeyframe(GenTime pos, const QVariant &value, Fun &undo, Fun &redo, bool update)
{
QWriteLocker locker(&m_lock);
Q_ASSERT(m_keyframeList.count(pos) > 0);
......@@ -367,7 +368,7 @@ bool KeyframeModel::updateKeyframe(GenTime pos, QVariant value)
Fun undo = []() { return true; };
Fun redo = []() { return true; };
bool res = updateKeyframe(pos, value, undo, redo);
bool res = updateKeyframe(pos, std::move(value), undo, redo);
if (res) {
PUSH_UNDO(undo, redo, i18n("Update keyframe"));
}
......@@ -407,7 +408,7 @@ bool KeyframeModel::updateKeyframeType(GenTime pos, int type, Fun &undo, Fun &re
return res;
}
Fun KeyframeModel::updateKeyframe_lambda(GenTime pos, KeyframeType type, QVariant value, bool notify)
Fun KeyframeModel::updateKeyframe_lambda(GenTime pos, KeyframeType type, const QVariant &value, bool notify)
{
QWriteLocker locker(&m_lock);
return [this, pos, type, value, notify]() {
......@@ -421,7 +422,7 @@ Fun KeyframeModel::updateKeyframe_lambda(GenTime pos, KeyframeType type, QVarian
};
}
Fun KeyframeModel::addKeyframe_lambda(GenTime pos, KeyframeType type, QVariant value, bool notify)
Fun KeyframeModel::addKeyframe_lambda(GenTime pos, KeyframeType type, const QVariant &value, bool notify)
{
QWriteLocker locker(&m_lock);
return [this, notify, pos, type, value]() {
......@@ -696,7 +697,7 @@ QString KeyframeModel::getAnimProperty() const
int ix = 0;
bool first = true;
std::shared_ptr<Mlt::Animation> anim;
for (const auto keyframe : m_keyframeList) {
for (const auto &keyframe : m_keyframeList) {
if (first) {
switch (m_paramType) {
case ParamType::AnimatedRect:
......@@ -736,7 +737,7 @@ QString KeyframeModel::getRotoProperty() const
int in = ptr->data(m_index, AssetParameterModel::ParentInRole).toInt();
int out = ptr->data(m_index, AssetParameterModel::ParentDurationRole).toInt();
QMap<QString, QVariant> map;
for (const auto keyframe : m_keyframeList) {
for (const auto &keyframe : m_keyframeList) {
map.insert(QString::number(in + keyframe.first.frames(pCore->getCurrentFps())).rightJustified(log10((double)out) + 1, '0'), keyframe.second.second);
}
doc = QJsonDocument::fromVariant(QVariant(map));
......@@ -893,7 +894,7 @@ QVariant KeyframeModel::getInterpolatedValue(int p) const
return getInterpolatedValue(pos);
}
QVariant KeyframeModel::updateInterpolated(QVariant interpValue, double val)
QVariant KeyframeModel::updateInterpolated(const QVariant &interpValue, double val)
{
QStringList vals = interpValue.toString().split(QLatin1Char(' '));
QLocale locale;
......@@ -1103,7 +1104,7 @@ void KeyframeModel::reset()
m_lastData = animData;
}
QList<QPoint> KeyframeModel::getRanges(const QString &animData, std::shared_ptr<AssetParameterModel> model)
QList<QPoint> KeyframeModel::getRanges(const QString &animData, const std::shared_ptr<AssetParameterModel> &model)
{
Mlt::Properties mlt_prop;
model->passProperties(mlt_prop);
......
......@@ -109,7 +109,7 @@ public:
Q_INVOKABLE bool updateKeyframe(int pos, double newVal);
bool updateKeyframe(GenTime pos, QVariant value);
bool updateKeyframeType(GenTime pos, int type, Fun &undo, Fun &redo);
bool updateKeyframe(GenTime pos, QVariant value, Fun &undo, Fun &redo, bool update = true);
bool updateKeyframe(GenTime pos, const QVariant &value, Fun &undo, Fun &redo, bool update = true);
/* @brief updates the value of a keyframe, without any management of undo/redo
@param pos is the position of the keyframe
@param value is the new value of the param
......@@ -155,7 +155,7 @@ public:
/* @brief Return the interpolated value at given pos */
QVariant getInterpolatedValue(int pos) const;
QVariant getInterpolatedValue(const GenTime &pos) const;
QVariant updateInterpolated(QVariant interpValue, double val);
QVariant updateInterpolated(const QVariant &interpValue, double val);
/* @brief Return the real value from a normalized one */
QVariant getNormalizedValue(double newVal) const;
......@@ -163,15 +163,15 @@ public:
Q_INVOKABLE QVariant data(const QModelIndex &index, int role) const override;
QHash<int, QByteArray> roleNames() const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
static QList<QPoint> getRanges(const QString &animData, std::shared_ptr<AssetParameterModel> model);
static QList<QPoint> getRanges(const QString &animData, const std::shared_ptr<AssetParameterModel> &model);
static std::shared_ptr<Mlt::Properties> getAnimation(const QString &animData);
protected:
/** @brief Helper function that generate a lambda to change type / value of given keyframe */
Fun updateKeyframe_lambda(GenTime pos, KeyframeType type, QVariant value, bool notify);
Fun updateKeyframe_lambda(GenTime pos, KeyframeType type, const QVariant &value, bool notify);
/** @brief Helper function that generate a lambda to add given keyframe */
Fun addKeyframe_lambda(GenTime pos, KeyframeType type, QVariant value, bool notify);
Fun addKeyframe_lambda(GenTime pos, KeyframeType type, const QVariant &value, bool notify);
/** @brief Helper function that generate a lambda to remove given keyframe */
Fun deleteKeyframe_lambda(GenTime pos, bool notify);
......
......@@ -30,10 +30,10 @@
#include <kdenlivesettings.h>
#include <QDebug>
#include <utility>
KeyframeModelList::KeyframeModelList(std::weak_ptr<AssetParameterModel> model, const QModelIndex &index, std::weak_ptr<DocUndoStack> undo_stack)
: m_model(model)
, m_undoStack(undo_stack)
: m_model(std::move(model))
, m_undoStack(std::move(undo_stack))
, m_lock(QReadWriteLock::Recursive)
{
qDebug() << "Construct keyframemodellist. Checking model:" << m_model.expired();
......@@ -159,7 +159,7 @@ bool KeyframeModelList::moveKeyframe(GenTime oldPos, GenTime pos, bool logUndo)
return applyOperation(op, logUndo ? i18n("Move keyframe") : QString());
}
bool KeyframeModelList::updateKeyframe(GenTime oldPos, GenTime pos, QVariant normalizedVal, bool logUndo)
bool KeyframeModelList::updateKeyframe(GenTime oldPos, GenTime pos, const QVariant &normalizedVal, bool logUndo)
{
QWriteLocker locker(&m_lock);
Q_ASSERT(m_parameters.size() > 0);
......@@ -193,7 +193,7 @@ bool KeyframeModelList::updateKeyframe(GenTime oldPos, GenTime pos, QVariant nor
return applyOperation(op, logUndo ? i18n("Move keyframe") : QString());
}
bool KeyframeModelList::updateKeyframe(GenTime pos, QVariant value, const QPersistentModelIndex &index)
bool KeyframeModelList::updateKeyframe(GenTime pos, const QVariant &value, const QPersistentModelIndex &index)
{
if (singleKeyframe()) {
bool ok = false;
......
......@@ -82,9 +82,9 @@ public:
@param value is the new value of the param
@param index is the index of the wanted keyframe
*/
bool updateKeyframe(GenTime pos, QVariant value, const QPersistentModelIndex &index);
bool updateKeyframe(GenTime pos, const QVariant &value, const QPersistentModelIndex &index);
bool updateKeyframeType(GenTime pos, int type, const QPersistentModelIndex &index);
bool updateKeyframe(GenTime oldPos, GenTime pos, QVariant normalizedVal, bool logUndo = true);
bool updateKeyframe(GenTime oldPos, GenTime pos, const QVariant &normalizedVal, bool logUndo = true);
KeyframeType keyframeType(GenTime pos) const;
/* @brief Returns a keyframe data at given pos
ok is a return parameter, set to true if everything went good
......
......@@ -24,11 +24,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "monitor/monitor.h"
#include <QSize>
KeyframeMonitorHelper::KeyframeMonitorHelper(Monitor *monitor, std::shared_ptr<AssetParameterModel> model, QPersistentModelIndex index, QObject *parent)
#include <utility>
KeyframeMonitorHelper::KeyframeMonitorHelper(Monitor *monitor, std::shared_ptr<AssetParameterModel> model, const QPersistentModelIndex &index, QObject *parent)
: QObject(parent)
, m_monitor(monitor)
, m_model(model)
, m_model(std::move(model))
, m_active(false)
{
m_indexes << index;
......@@ -48,7 +48,7 @@ bool KeyframeMonitorHelper::connectMonitor(bool activate)
return m_active;
}
void KeyframeMonitorHelper::addIndex(QPersistentModelIndex index)
void KeyframeMonitorHelper::addIndex(const QPersistentModelIndex &index)
{
m_indexes << index;
}
......@@ -46,7 +46,7 @@ public:
@param model is the asset this parameter belong to
@param index is the index of this parameter in its model
*/
explicit KeyframeMonitorHelper(Monitor *monitor, std::shared_ptr<AssetParameterModel> model, QPersistentModelIndex index, QObject *parent = nullptr);
explicit KeyframeMonitorHelper(Monitor *monitor, std::shared_ptr<AssetParameterModel> model, const QPersistentModelIndex &index, QObject *parent = nullptr);
/** @brief Send signals to the monitor to update the qml overlay.
@param returns : true if the monitor's connection was changed to active.
*/
......@@ -69,7 +69,7 @@ private slots:
public slots:
/** @brief For classes that manage several parameters, add a param index to the list
*/
void addIndex(QPersistentModelIndex index);
void addIndex(const QPersistentModelIndex &index);
signals:
/** @brief Send updated keyframe data to the parameter @index
......
......@@ -26,9 +26,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "monitor/monitor.h"
#include <QSize>
#include <utility>
RotoHelper::RotoHelper(Monitor *monitor, std::shared_ptr<AssetParameterModel> model, QPersistentModelIndex index, QObject *parent)
: KeyframeMonitorHelper(monitor, model, index, parent)
: KeyframeMonitorHelper(monitor, std::move(model), std::move(index), parent)
{
}
......@@ -38,7 +38,7 @@ void RotoHelper::slotUpdateFromMonitorData(const QVariantList &v)
emit updateKeyframeData(m_indexes.first(), res);
}
QVariant RotoHelper::getSpline(QVariant value, const QSize frame)
QVariant RotoHelper::getSpline(const QVariant &value, const QSize frame)
{
QList<BPoint> bPoints;
const QVariantList points = value.toList();
......@@ -76,7 +76,7 @@ void RotoHelper::refreshParams(int pos)
}
}
QList<BPoint> RotoHelper::getPoints(QVariant value, const QSize frame)
QList<BPoint> RotoHelper::getPoints(const QVariant &value, const QSize frame)
{
QList<BPoint> points;
QList<QVariant> data = value.toList();
......
......@@ -44,12 +44,12 @@ public:
/** @brief Send signals to the monitor to update the qml overlay.
@param returns : true if the monitor's connection was changed to active.
*/
static QVariant getSpline(QVariant value, const QSize frame);
static QVariant getSpline(const QVariant &value, const QSize frame);
/** @brief Returns a list of spline control points, based on its string definition and frame size
@param value : the spline's string definition
@param frame: the frame size
*/
static QList<BPoint> getPoints(QVariant value, const QSize frame);
static QList<BPoint> getPoints(const QVariant &value, const QSize frame);
void refreshParams(int pos) override;
private slots:
......
......@@ -27,10 +27,10 @@
#include <KColorScheme>
#include <QFontDatabase>
#include <utility>
KeyframeView::KeyframeView(std::shared_ptr<KeyframeModelList> model, int duration, QWidget *parent)
: QWidget(parent)
, m_model(model)
, m_model(std::move(model))
, m_duration(duration)
, m_position(0)
, m_currentKeyframe(-1)
......
......@@ -25,7 +25,7 @@
#include "transitions/transitionsrepository.hpp"
#include <memory>
AssetCommand::AssetCommand(std::shared_ptr<AssetParameterModel> model, const QModelIndex &index, const QString &value, QUndoCommand *parent)
AssetCommand::AssetCommand(const std::shared_ptr<AssetParameterModel> &model, const QModelIndex &index, const QString &value, QUndoCommand *parent)
: QUndoCommand(parent)
, m_model(model)
, m_index(index)
......@@ -73,7 +73,7 @@ bool AssetCommand::mergeWith(const QUndoCommand *other)
return true;
}
AssetKeyframeCommand::AssetKeyframeCommand(std::shared_ptr<AssetParameterModel> model, const QModelIndex &index, const QVariant &value, GenTime pos,
AssetKeyframeCommand::AssetKeyframeCommand(const std::shared_ptr<AssetParameterModel> &model, const QModelIndex &index, const QVariant &value, GenTime pos,
QUndoCommand *parent)
: QUndoCommand(parent)
, m_model(model)
......@@ -120,7 +120,8 @@ bool AssetKeyframeCommand::mergeWith(const QUndoCommand *other)
return true;
}
AssetUpdateCommand::AssetUpdateCommand(std::shared_ptr<AssetParameterModel> model, const QVector<QPair<QString, QVariant>> parameters, QUndoCommand *parent)
AssetUpdateCommand::AssetUpdateCommand(const std::shared_ptr<AssetParameterModel> &model, const QVector<QPair<QString, QVariant>> &parameters,
QUndoCommand *parent)
: QUndoCommand(parent)
, m_model(model)
, m_value(parameters)
......
......@@ -30,7 +30,7 @@
class AssetCommand : public QUndoCommand
{
public:
AssetCommand(std::shared_ptr<AssetParameterModel> model, const QModelIndex &index, const QString &value, QUndoCommand *parent = nullptr);
AssetCommand(const std::shared_ptr<AssetParameterModel> &model, const QModelIndex &index, const QString &value, QUndoCommand *parent = nullptr);
void undo() override;
void redo() override;
int id() const override;
......@@ -49,7 +49,7 @@ private:
class AssetKeyframeCommand : public QUndoCommand
{
public:
AssetKeyframeCommand(std::shared_ptr<AssetParameterModel> model, const QModelIndex &index, const QVariant &value, GenTime pos,
AssetKeyframeCommand(const std::shared_ptr<AssetParameterModel> &model, const QModelIndex &index, const QVariant &value, GenTime pos,
QUndoCommand *parent = nullptr);
void undo() override;
void redo() override;
......@@ -69,7 +69,7 @@ private:
class AssetUpdateCommand : public QUndoCommand
{
public:
AssetUpdateCommand(std::shared_ptr<AssetParameterModel> model, QVector<QPair<QString, QVariant>> parameters, QUndoCommand *parent = nullptr);
AssetUpdateCommand(const std::shared_ptr<AssetParameterModel> &model, const QVector<QPair<QString, QVariant>> &parameters, QUndoCommand *parent = nullptr);
void undo() override;
void redo() override;
int id() const override;
......
......@@ -191,7 +191,7 @@ void AssetParameterModel::setParameter(const QString &name, const QString &param
// for the curve, inpoints are numbered: 6, 8, 10, 12, 14
// outpoints, 7, 9, 11, 13,15 so we need to deduce these enums
for (int i = 0; i < points; i++) {
QString pointVal = vals.at(i);
const QString &pointVal = vals.at(i);
int idx = 2 * i + 6;
m_asset->set(QString::number(idx).toLatin1().constData(), pointVal.section(QLatin1Char('/'), 0, 0).toDouble());
idx++;
......@@ -805,7 +805,7 @@ bool AssetParameterModel::hasMoreThanOneKeyframe() const
return false;
}
int AssetParameterModel::time_to_frames(const QString time)
int AssetParameterModel::time_to_frames(const QString &time)
{
return m_asset->time_to_frames(time.toUtf8().constData());
}
......
......@@ -164,7 +164,7 @@ public:
void resetAsset(std::unique_ptr<Mlt::Properties> asset);
/* @brief Returns true if the effect has more than one keyframe */
bool hasMoreThanOneKeyframe() const;
int time_to_frames(const QString time);
int time_to_frames(const QString &time);
void passProperties(Mlt::Properties &target);
protected:
......
......@@ -326,7 +326,7 @@ int KisCurveWidget::nearestPointInRange(QPointF pt, int wWidth, int wHeight) con
// }
void KisCurveWidget::setCurve(KisCubicCurve &&curve)
{
m_curve = std::move(curve);
m_curve = curve;
}
QList<QPointF> KisCurveWidget::getPoints() const
......