Commit 3b9d8bfd authored by Vincent Pinon's avatar Vincent Pinon

Manually fix clazy warnings

parent d265f635
Pipeline #28060 passed with stage
in 16 minutes and 9 seconds
......@@ -29,7 +29,6 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
QStringList args = app.arguments();
QStringList preargs;
QString locale;
if (args.count() >= 4) {
// Remove program name
args.removeFirst();
......@@ -92,7 +91,7 @@ int main(int argc, char **argv)
QLocale::setDefault(QLocale(localename));
for (const QString &frame : qAsConst(chunks)) {
fprintf(stderr, "START:%d \n", frame.toInt());
QString fileName = QStringLiteral("%1.%2").arg(frame).arg(extension);
QString fileName = QStringLiteral("%1.%2").arg(frame,extension);
if (baseFolder.exists(fileName)) {
// Don't overwrite an existing file
fprintf(stderr, "DONE:%d \n", frame.toInt());
......
......@@ -68,7 +68,7 @@ AssetPanel::AssetPanel(QWidget *parent)
for (const auto &transition : qAsConst(allTransitions)) {
m_switchCompoButton->addItem(transition.second, transition.first);
}
connect(m_switchCompoButton, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), [&]() {
connect(m_switchCompoButton, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, [&]() {
if (m_transitionWidget->stackOwner().first == ObjectType::TimelineComposition) {
emit switchCurrentComposition(m_transitionWidget->stackOwner().second, m_switchCompoButton->currentData().toString());
}
......@@ -141,7 +141,7 @@ AssetPanel::AssetPanel(QWidget *parent)
connect(m_effectStackWidget, &EffectStackView::seekToPos, this, &AssetPanel::seekToPos);
connect(m_effectStackWidget, &EffectStackView::reloadEffect, this, &AssetPanel::reloadEffect);
connect(m_transitionWidget, &TransitionStackView::seekToTransPos, this, &AssetPanel::seekToPos);
connect(m_effectStackWidget, &EffectStackView::updateEnabledState, [this]() { m_enableStackButton->setActive(m_effectStackWidget->isStackEnabled()); });
connect(m_effectStackWidget, &EffectStackView::updateEnabledState, this, [this]() { m_enableStackButton->setActive(m_effectStackWidget->isStackEnabled()); });
}
void AssetPanel::showTransition(int tid, const std::shared_ptr<AssetParameterModel> &transitionModel)
......@@ -217,7 +217,7 @@ void AssetPanel::showEffectStack(const QString &itemName, const std::shared_ptr<
m_enableStackButton->setActive(effectsModel->isStackEnabled());
if (showSplit) {
m_splitButton->setEnabled(effectsModel->rowCount() > 0);
QObject::connect(effectsModel.get(), &EffectStackModel::dataChanged, [&]() {
QObject::connect(effectsModel.get(), &EffectStackModel::dataChanged, this, [&]() {
if (m_effectStackWidget->isEmpty()) {
m_splitButton->setActive(false);
}
......@@ -394,7 +394,7 @@ void AssetPanel::enableStack(bool enable)
void AssetPanel::deleteCurrentEffect()
{
if (m_effectStackWidget->isVisible()) {
m_effectStackWidget->removeCurrentEffect();
emit m_effectStackWidget->removeCurrentEffect();
}
}
......@@ -414,7 +414,7 @@ void AssetPanel::slotCheckWheelEventFilter()
// widget has scroll bar,
blockWheel = true;
}
m_effectStackWidget->blockWheenEvent(blockWheel);
emit m_effectStackWidget->blockWheenEvent(blockWheel);
}
void AssetPanel::assetPanelWarning(const QString service, const QString /*id*/, const QString message)
......
......@@ -51,7 +51,6 @@ void CornersHelper::slotUpdateFromMonitorData(const QVariantList &v)
void CornersHelper::refreshParams(int pos)
{
QVariantList points{QPointF(), QPointF(), QPointF(), QPointF()};
QList<double> coords;
QSize frameSize = pCore->getCurrentFrameSize();
for (const auto &ix : qAsConst(m_indexes)) {
auto type = m_model->data(ix, AssetParameterModel::TypeRole).value<ParamType>();
......
......@@ -862,7 +862,6 @@ void KeyframeModel::parseRotoProperty(const QString &prop)
QJsonDocument doc = QJsonDocument::fromJson(prop.toLatin1(), &jsonError);
QVariant data = doc.toVariant();
if (data.canConvert(QVariant::Map)) {
QList<int> keyframes;
QMap<QString, QVariant> map = data.toMap();
QMap<QString, QVariant>::const_iterator i = map.constBegin();
while (i != map.constEnd()) {
......
......@@ -217,7 +217,7 @@ AssetParameterModel::AssetParameterModel(std::unique_ptr<Mlt::Properties> asset,
}
qDebug() << "END parsing of " << assetId << ". Number of found parameters" << m_rows.size();
emit modelChanged();
modelChanged();
}
void AssetParameterModel::prepareKeyframes()
......
......@@ -58,7 +58,7 @@ void AssetParameterView::setModel(const std::shared_ptr<AssetParameterModel> &mo
const QString paramTag = model->getAssetId();
QDir dir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/effects/presets/"));
const QString presetFile = dir.absoluteFilePath(QString("%1.json").arg(paramTag));
connect(this, &AssetParameterView::updatePresets, [this, presetFile](const QString &presetName) {
connect(this, &AssetParameterView::updatePresets, this, [this, presetFile](const QString &presetName) {
m_presetMenu->clear();
m_presetGroup.reset(new QActionGroup(this));
m_presetGroup->setExclusive(true);
......@@ -92,7 +92,7 @@ void AssetParameterView::setModel(const std::shared_ptr<AssetParameterModel> &mo
connect(w, &AbstractParamWidget::valuesChanged, this, &AssetParameterView::commitMultipleChanges);
connect(w, &AbstractParamWidget::valueChanged, this, &AssetParameterView::commitChanges);
m_lay->addWidget(w);
connect(w, &AbstractParamWidget::updateHeight, [&](int h) {
connect(w, &AbstractParamWidget::updateHeight, this, [&](int h) {
setFixedHeight(h + m_lay->contentsMargins().bottom());
emit updateHeight();
});
......@@ -113,7 +113,7 @@ void AssetParameterView::setModel(const std::shared_ptr<AssetParameterModel> &mo
connect(w, &AbstractParamWidget::valueChanged, this, &AssetParameterView::commitChanges);
connect(w, &AbstractParamWidget::seekToPos, this, &AssetParameterView::seekToPos);
connect(w, &AbstractParamWidget::activateEffect, this, &AssetParameterView::activateEffect);
connect(w, &AbstractParamWidget::updateHeight, [&]() {
connect(w, &AbstractParamWidget::updateHeight, this, [&]() {
setFixedHeight(contentHeight());
emit updateHeight();
});
......
......@@ -94,6 +94,9 @@ protected:
QMenu *m_presetMenu;
std::shared_ptr<QActionGroup> m_presetGroup;
private:
QVector<QPair<QString, QVariant>> getDefaultValues() const;
private slots:
/** @brief Apply a change of parameter sent by the view
@param index is the index corresponding to the modified param
......@@ -102,7 +105,6 @@ private slots:
*/
void commitChanges(const QModelIndex &index, const QString &value, bool storeUndo);
void commitMultipleChanges(const QList <QModelIndex> indexes, const QStringList &values, bool storeUndo);
QVector<QPair<QString, QVariant>> getDefaultValues() const;
signals:
void seekToPos(int);
......
......@@ -41,7 +41,7 @@ BoolParamWidget::BoolParamWidget(std::shared_ptr<AssetParameterModel> model, QMo
slotRefresh();
// emit the signal of the base class when appropriate
connect(this->m_checkBox, &QCheckBox::stateChanged, [this](int state) {
connect(this->m_checkBox, &QCheckBox::stateChanged, this, [this](int state) {
emit valueChanged(m_index, QString::number(state), true); });
}
......
......@@ -89,7 +89,7 @@ ButtonParamWidget::ButtonParamWidget(std::shared_ptr<AssetParameterModel> model,
setMinimumHeight(m_button->sizeHint().height() + (m_label != nullptr ? m_label->sizeHint().height() : 0));
// emit the signal of the base class when appropriate
connect(this->m_button, &QPushButton::clicked, [&, filterData, filterAddedParams, consumerParams]() {
connect(this->m_button, &QPushButton::clicked, this, [&, filterData, filterAddedParams, consumerParams]() {
// Trigger job
if (!m_displayConditional) {
QVector<QPair<QString, QVariant>> values;
......@@ -133,7 +133,7 @@ ButtonParamWidget::ButtonParamWidget(std::shared_ptr<AssetParameterModel> model,
fParams.insert({fparam.section(QLatin1Char('='), 0, 0), fparam.section(QLatin1Char('='), 1)});
}
}
pCore->jobManager()->startJob<FilterClipJob>({binId}, -1, QString(), owner, m_model, assetId, in, out, assetId, fParams, fData, consumerParams);
emit pCore->jobManager()->startJob<FilterClipJob>({binId}, -1, QString(), owner, m_model, assetId, in, out, assetId, fParams, fData, consumerParams);
if (m_label) {
m_label->setVisible(false);
}
......
......@@ -38,7 +38,6 @@ ClickableLabelParamWidget::ClickableLabelParamWidget(std::shared_ptr<AssetParame
{
// setup the comment
m_displayName = m_model->data(m_index, Qt::DisplayRole).toString();
QString name = m_model->data(m_index, AssetParameterModel::NameRole).toString();
QString comment = m_model->data(m_index, AssetParameterModel::CommentRole).toString();
setToolTip(comment);
auto *layout = new QHBoxLayout(this);
......@@ -50,12 +49,12 @@ ClickableLabelParamWidget::ClickableLabelParamWidget(std::shared_ptr<AssetParame
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_tb);
layout->addWidget(m_label);
connect(m_tb, &QToolButton::clicked, [&]() {
connect(m_tb, &QToolButton::clicked, this, [&]() {
QClipboard *clipboard = QApplication::clipboard();
QString value = m_model->data(m_index, AssetParameterModel::ValueRole).toString();
clipboard->setText(value);
});
connect(m_label, &QLabel::linkActivated, [&](const QString &result) {
connect(m_label, &QLabel::linkActivated, this, [&](const QString &result) {
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(result);
});
......
......@@ -519,7 +519,7 @@ ColorWheel::ColorWheel(QString id, QString name, NegQColor color, QWidget *paren
hb->setContentsMargins(0, 0, 0, 0);
lay->addLayout(hb);
m_container->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
connect(m_container, &WheelContainer::colorChange, [&] (const NegQColor &col) {
connect(m_container, &WheelContainer::colorChange, this, [&] (const NegQColor &col) {
QList <double> vals = m_container->getNiceParamValues();
m_redEdit->blockSignals(true);
m_greenEdit->blockSignals(true);
......@@ -532,13 +532,13 @@ ColorWheel::ColorWheel(QString id, QString name, NegQColor color, QWidget *paren
m_blueEdit->blockSignals(false);
emit colorChange(col);
});
connect(m_redEdit, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), [&]() {
connect(m_redEdit, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), this, [&]() {
m_container->setRedColor(m_redEdit->value());
});
connect(m_greenEdit, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), [&]() {
connect(m_greenEdit, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), this, [&]() {
m_container->setGreenColor(m_greenEdit->value());
});
connect(m_blueEdit, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), [&]() {
connect(m_blueEdit, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), this, [&]() {
m_container->setBlueColor(m_blueEdit->value());
});
setMinimumHeight(m_wheelName->height() + m_container->minimumHeight() + m_redEdit->height());
......@@ -555,7 +555,6 @@ NegQColor ColorWheel::color() const
void ColorWheel::setColor(QList<double> values)
{
m_container->setColor(values);
QList <double> vals = m_container->getNiceParamValues();
m_redEdit->blockSignals(true);
m_greenEdit->blockSignals(true);
m_blueEdit->blockSignals(true);
......
......@@ -49,7 +49,7 @@ DoubleParamWidget::DoubleParamWidget(std::shared_ptr<AssetParameterModel> model,
setMinimumHeight(m_doubleWidget->height());
// Connect signal
connect(m_doubleWidget, &DoubleWidget::valueChanged, [this](double val) { emit valueChanged(m_index, QString::number(val, 'f'), true); });
connect(m_doubleWidget, &DoubleWidget::valueChanged, this, [this](double val) { emit valueChanged(m_index, QString::number(val, 'f'), true); });
slotRefresh();
}
......
......@@ -38,7 +38,7 @@ FontParamWidget::FontParamWidget(std::shared_ptr<AssetParameterModel> model, QMo
slotRefresh();
setMinimumHeight(fontfamilywidget->sizeHint().height());
// emit the signal of the base class when appropriate
connect(this->fontfamilywidget, &QFontComboBox::currentFontChanged, [this](const QFont &font) { emit valueChanged(m_index, font.family(), true); });
connect(this->fontfamilywidget, &QFontComboBox::currentFontChanged, this, [this](const QFont &font) { emit valueChanged(m_index, font.family(), true); });
}
void FontParamWidget::slotShowComment(bool show)
......
......@@ -57,7 +57,7 @@ GeometryEditWidget::GeometryEditWidget(std::shared_ptr<AssetParameterModel> mode
setFixedHeight(m_geom->sizeHint().height());
// emit the signal of the base class when appropriate
connect(this->m_geom, &GeometryWidget::valueChanged, [this](const QString val) { emit valueChanged(m_index, val, true); });
connect(this->m_geom, &GeometryWidget::valueChanged, this, [this](const QString val) { emit valueChanged(m_index, val, true); });
setToolTip(comment);
}
......
......@@ -372,7 +372,6 @@ void KeyframeImport::updateDestinationRange()
m_destMin.setEnabled(true);
m_destMax.setEnabled(true);
m_limitRange->setEnabled(true);
QString tag = m_targetCombo->currentData().toString();
double min = m_model->data(m_targetCombo->currentData().toModelIndex(), AssetParameterModel::MinRole).toDouble();
double max = m_model->data(m_targetCombo->currentData().toModelIndex(), AssetParameterModel::MaxRole).toDouble();
m_destMin.setRange(min, max);
......
......@@ -143,7 +143,7 @@ KeyframeWidget::KeyframeWidget(std::shared_ptr<AssetParameterModel> model, QMode
break;
}
connect(kfType, static_cast<void (KSelectAction::*)(QAction *)>(&KSelectAction::triggered),
[&](QAction *ac) { KdenliveSettings::setDefaultkeyframeinterp(ac->data().toInt()); });
this, [&](QAction *ac) { KdenliveSettings::setDefaultkeyframeinterp(ac->data().toInt()); });
auto *container = new QMenu(this);
container->addAction(copy);
container->addAction(paste);
......@@ -164,8 +164,8 @@ KeyframeWidget::KeyframeWidget(std::shared_ptr<AssetParameterModel> model, QMode
m_lay->addWidget(m_toolbar);
monitorSeek(monitor->position());
connect(m_time, &TimecodeDisplay::timeCodeEditingFinished, [&]() { slotSetPosition(-1, true); });
connect(m_keyframeview, &KeyframeView::seekToPos, [&](int p) { slotSetPosition(p, true); });
connect(m_time, &TimecodeDisplay::timeCodeEditingFinished, this, [&]() { slotSetPosition(-1, true); });
connect(m_keyframeview, &KeyframeView::seekToPos, this, [&](int p) { slotSetPosition(p, true); });
connect(m_keyframeview, &KeyframeView::atKeyframe, this, &KeyframeWidget::slotAtKeyframe);
connect(m_keyframeview, &KeyframeView::modified, this, &KeyframeWidget::slotRefreshParams);
connect(m_keyframeview, &KeyframeView::activateEffect, this, &KeyframeWidget::activateEffect);
......@@ -210,7 +210,7 @@ void KeyframeWidget::slotEditKeyframeType(QAction *action)
{
int type = action->data().toInt();
m_keyframeview->slotEditType(type, m_index);
activateEffect();
emit activateEffect();
}
void KeyframeWidget::slotRefreshParams()
......@@ -356,8 +356,8 @@ void KeyframeWidget::addParameter(const QPersistentModelIndex &index)
GeometryWidget *geomWidget = new GeometryWidget(pCore->getMonitor(m_model->monitorId), range, rect, opacity, m_sourceFrameSize, false,
m_model->data(m_index, AssetParameterModel::OpacityRole).toBool(), integerOpacity, this);
connect(geomWidget, &GeometryWidget::valueChanged,
[this, index](const QString v) {
activateEffect();
this, [this, index](const QString v) {
emit activateEffect();
m_keyframes->updateKeyframe(GenTime(getPosition(), pCore->getCurrentFps()), QVariant(v), index); });
paramWidget = geomWidget;
} else if (type == ParamType::Roto_spline) {
......@@ -390,8 +390,8 @@ void KeyframeWidget::addParameter(const QPersistentModelIndex &index)
factor = qFuzzyIsNull(factor) ? 1 : factor;
auto doubleWidget = new DoubleWidget(name, value, min, max, factor, defaultValue, comment, -1, suffix, decimals, m_model->data(index, AssetParameterModel::OddRole).toBool(), this);
connect(doubleWidget, &DoubleWidget::valueChanged,
[this, index](double v) {
activateEffect();
this, [this, index](double v) {
emit activateEffect();
m_keyframes->updateKeyframe(GenTime(getPosition(), pCore->getCurrentFps()), QVariant(v), index);
});
paramWidget = doubleWidget;
......@@ -432,7 +432,7 @@ void KeyframeWidget::connectMonitor(bool active)
void KeyframeWidget::slotUpdateKeyframesFromMonitor(const QPersistentModelIndex &index, const QVariant &res)
{
activateEffect();
emit activateEffect();
if (m_keyframes->isEmpty()) {
GenTime pos(pCore->getItemIn(m_model->getOwnerId()) + m_time->getValue(), pCore->getCurrentFps());
if (m_time->getValue() > 0) {
......
......@@ -28,7 +28,6 @@ KeywordParamWidget::KeywordParamWidget(std::shared_ptr<AssetParameterModel> mode
setupUi(this);
// setup the comment
QString name = m_model->data(m_index, AssetParameterModel::NameRole).toString();
QString comment = m_model->data(m_index, AssetParameterModel::CommentRole).toString();
setToolTip(comment);
......@@ -53,11 +52,11 @@ KeywordParamWidget::KeywordParamWidget(std::shared_ptr<AssetParameterModel> mode
setMinimumHeight(comboboxwidget->sizeHint().height());
// emit the signal of the base class when appropriate
connect(lineeditwidget, &QLineEdit::editingFinished, [this]() {
connect(lineeditwidget, &QLineEdit::editingFinished, this, [this]() {
emit valueChanged(m_index, lineeditwidget->text(), true);
});
connect(comboboxwidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
[this](int ix) {
this, [this](int ix) {
if (ix > 0) {
QString comboval = comboboxwidget->itemData(ix).toString();
this->lineeditwidget->insert(comboval);
......
......@@ -30,7 +30,6 @@ ListParamWidget::ListParamWidget(std::shared_ptr<AssetParameterModel> model, QMo
setupUi(this);
// Get data from model
QString name = m_model->data(m_index, AssetParameterModel::NameRole).toString();
QString comment = m_model->data(m_index, AssetParameterModel::CommentRole).toString();
// setup the comment
......@@ -47,7 +46,7 @@ ListParamWidget::ListParamWidget(std::shared_ptr<AssetParameterModel> model, QMo
// emit the signal of the base class when appropriate
// The connection is ugly because the signal "currentIndexChanged" is overloaded in QComboBox
connect(this->m_list, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
[this](int) {
this, [this](int) {
emit valueChanged(m_index, m_list->itemData(m_list->currentIndex()).toString(), true);
});
}
......
......@@ -51,7 +51,7 @@ PositionEditWidget::PositionEditWidget(std::shared_ptr<AssetParameterModel> mode
connect(m_slider, &QAbstractSlider::valueChanged, this, &PositionEditWidget::valueChanged);
// emit the signal of the base class when appropriate
connect(this->m_slider, &QAbstractSlider::valueChanged, [this](int val) {
connect(this->m_slider, &QAbstractSlider::valueChanged, this, [this](int val) {
if (m_inverted) {
val = m_model->data(m_index, AssetParameterModel::ParentInRole).toInt() + m_model->data(m_index, AssetParameterModel::ParentDurationRole).toInt() - 1 -
val;
......
......@@ -25,7 +25,6 @@ SlideWidget::SlideWidget(std::shared_ptr<AssetParameterModel> model, QModelIndex
{
// setup the comment
setupUi(this);
QString name = m_model->data(m_index, AssetParameterModel::NameRole).toString();
QString comment = m_model->data(m_index, AssetParameterModel::CommentRole).toString();
slotRefresh();
......
......@@ -28,7 +28,6 @@ SwitchParamWidget::SwitchParamWidget(std::shared_ptr<AssetParameterModel> model,
setupUi(this);
// setup the comment
QString name = m_model->data(m_index, AssetParameterModel::NameRole).toString();
QString comment = m_model->data(m_index, AssetParameterModel::CommentRole).toString();
setToolTip(comment);
m_labelComment->setText(comment);
......@@ -42,7 +41,7 @@ SwitchParamWidget::SwitchParamWidget(std::shared_ptr<AssetParameterModel> model,
slotRefresh();
// emit the signal of the base class when appropriate
connect(this->m_checkBox, &QCheckBox::stateChanged, [this](int state) {
connect(this->m_checkBox, &QCheckBox::stateChanged, this, [this](int state) {
emit valueChanged(m_index,
(state == Qt::Checked ? m_model->data(m_index, AssetParameterModel::MaxRole).toString()
: m_model->data(m_index, AssetParameterModel::MinRole).toString()),
......
......@@ -30,7 +30,6 @@ UrlParamWidget::UrlParamWidget(std::shared_ptr<AssetParameterModel> model, QMode
setupUi(this);
// setup the comment
QString name = m_model->data(m_index, AssetParameterModel::NameRole).toString();
QString comment = m_model->data(m_index, AssetParameterModel::CommentRole).toString();
labelComment->setText(comment);
setToolTip(comment);
......@@ -49,7 +48,7 @@ UrlParamWidget::UrlParamWidget(std::shared_ptr<AssetParameterModel> model, QMode
slotRefresh();
// emit the signal of the base class when appropriate
connect(this->urlwidget, &KUrlRequester::textChanged, [this]() {
connect(this->urlwidget, &KUrlRequester::textChanged, this, [this]() {
QFileInfo info(urlwidget->url().toLocalFile());
if (info.exists() && info.isFile()) {
emit valueChanged(m_index, this->urlwidget->url().toLocalFile(), true);
......
......@@ -72,7 +72,7 @@ void MixerManager::registerTrack(int tid, std::shared_ptr<Mlt::Tractor> service,
return;
}
std::shared_ptr<MixerWidget> mixer(new MixerWidget(tid, service, trackTag, this));
connect(mixer.get(), &MixerWidget::muteTrack, [&](int id, bool mute) {
connect(mixer.get(), &MixerWidget::muteTrack, this, [&](int id, bool mute) {
m_model->setTrackProperty(id, "hide", mute ? QStringLiteral("1") : QStringLiteral("3"));
});
if (m_visibleMixerManager) {
......@@ -80,7 +80,7 @@ void MixerManager::registerTrack(int tid, std::shared_ptr<Mlt::Tractor> service,
}
connect(this, &MixerManager::updateLevels, mixer.get(), &MixerWidget::updateAudioLevel);
connect(this, &MixerManager::clearMixers, mixer.get(), &MixerWidget::clear);
connect(mixer.get(), &MixerWidget::toggleSolo, [&](int trid, bool solo) {
connect(mixer.get(), &MixerWidget::toggleSolo, this, [&](int trid, bool solo) {
if (!solo) {
// unmute
for (int id : qAsConst(m_soloMuted)) {
......@@ -143,7 +143,7 @@ void MixerManager::setModel(std::shared_ptr<TimelineItemModel> model)
{
// Insert master mixer
m_model = model;
connect(m_model.get(), &TimelineItemModel::dataChanged, [&](const QModelIndex &topLeft, const QModelIndex &, const QVector<int> &roles) {
connect(m_model.get(), &TimelineItemModel::dataChanged, this, [&](const QModelIndex &topLeft, const QModelIndex &, const QVector<int> &roles) {
if (roles.contains(TimelineModel::IsDisabledRole)) {
int id = (int) topLeft.internalId();
if (m_mixers.count(id) > 0) {
......@@ -160,7 +160,7 @@ void MixerManager::setModel(std::shared_ptr<TimelineItemModel> model)
m_masterBox->removeWidget(m_masterMixer.get());
}
m_masterMixer.reset(new MixerWidget(-1, service, i18n("Master"), this));
connect(m_masterMixer.get(), &MixerWidget::muteTrack, [&](int /*id*/, bool mute) {
connect(m_masterMixer.get(), &MixerWidget::muteTrack, this, [&](int /*id*/, bool mute) {
m_model->tractor()->set("hide", mute ? 3 : 1);
});
if (m_visibleMixerManager) {
......
......@@ -165,7 +165,7 @@ void MixerWidget::buildUI(Mlt::Tractor *service, const QString &trackTag)
m_volumeSpin->setSuffix(i18n("dB"));
m_volumeSpin->setFrame(false);
connect(m_volumeSpin, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), [&](double val) {
connect(m_volumeSpin, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), this, [&](double val) {
m_volumeSlider->setValue(fromDB(val));
});
......@@ -239,7 +239,7 @@ void MixerWidget::buildUI(Mlt::Tractor *service, const QString &trackTag)
connect(m_balanceDial, &QDial::valueChanged, m_balanceSpin, &QSpinBox::setValue);
connect(m_muteAction, &KDualAction::activeChangedByUser, [&](bool active) {
connect(m_muteAction, &KDualAction::activeChangedByUser, this, [&](bool active) {
if (m_tid == -1) {
// Muting master, special case
if (m_levelFilter) {
......@@ -263,7 +263,6 @@ void MixerWidget::buildUI(Mlt::Tractor *service, const QString &trackTag)
mute->setAutoRaise(true);
// Setup default width
QFontMetrics fm(font());
setFixedWidth(3 * mute->sizeHint().width());
if (m_tid > -1) {
......@@ -273,7 +272,7 @@ void MixerWidget::buildUI(Mlt::Tractor *service, const QString &trackTag)
m_solo->setIcon(QIcon::fromTheme("headphones"));
m_solo->setToolTip(i18n("Solo mode"));
m_solo->setAutoRaise(true);
connect(m_solo, &QToolButton::toggled, [&](bool toggled) {
connect(m_solo, &QToolButton::toggled, this, [&](bool toggled) {
emit toggleSolo(m_tid, toggled);
updateLabel();
});
......@@ -282,8 +281,8 @@ void MixerWidget::buildUI(Mlt::Tractor *service, const QString &trackTag)
m_record->setToolTip(i18n("Record"));
m_record->setCheckable(true);
m_record->setAutoRaise(true);
connect(m_record, &QToolButton::clicked, [&]() {
m_manager->recordAudio(m_tid);
connect(m_record, &QToolButton::clicked, this, [&]() {
emit m_manager->recordAudio(m_tid);
});
} else {
m_collapse = new QToolButton(this);
......@@ -292,19 +291,19 @@ void MixerWidget::buildUI(Mlt::Tractor *service, const QString &trackTag)
m_collapse->setCheckable(true);
m_collapse->setAutoRaise(true);
m_collapse->setChecked(KdenliveSettings::mixerCollapse() );
connect(m_collapse, &QToolButton::clicked, [&]() {
connect(m_collapse, &QToolButton::clicked, this, [&]() {
KdenliveSettings::setMixerCollapse(m_collapse->isChecked());
m_collapse->setIcon(m_collapse->isChecked() ? QIcon::fromTheme("arrow-left") : QIcon::fromTheme("arrow-right"));
m_manager->collapseMixers();
});
}
connect(m_volumeSlider, &QSlider::valueChanged, [&](int value) {
connect(m_volumeSlider, &QSlider::valueChanged, this, [&](int value) {
QSignalBlocker bk(m_volumeSpin);
if (m_recording) {
m_volumeSpin->setValue(value);
KdenliveSettings::setAudiocapturevolume(value);
m_manager->updateRecVolume();
emit m_manager->updateRecVolume();
//TODO update capture volume
} else if (m_levelFilter != nullptr) {
double dbValue = 0;
......@@ -318,18 +317,18 @@ void MixerWidget::buildUI(Mlt::Tractor *service, const QString &trackTag)
m_levelFilter->set("level", dbValue);
m_levelFilter->set("disable", value == 60 ? 1 : 0);
m_levels.clear();
m_manager->purgeCache();
emit m_manager->purgeCache();
pCore->setDocumentModified();
}
});
connect(m_balanceSpin, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [&](int value) {
connect(m_balanceSpin, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, [&](int value) {
QSignalBlocker bk(m_balanceDial);
m_balanceDial->setValue(value);
if (m_balanceFilter != nullptr) {
m_balanceFilter->set("start", (value + 50) / 100.);
m_balanceFilter->set("disable", value == 0 ? 1 : 0);
m_levels.clear();
m_manager->purgeCache();
emit m_manager->purgeCache();
pCore->setDocumentModified();
}
});
......@@ -398,7 +397,7 @@ void MixerWidget::updateLabel()
m_trackLabel->setPalette(pal);
} else if (m_muteAction->isActive()) {
QPalette pal = m_trackLabel->palette();
pal.setColor(QPalette::Window, QColor("#ff8c00"));
pal.setColor(QPalette::Window, QColor(0xff8c00));
m_trackLabel->setPalette(pal);
} else if (m_solo && m_solo->isChecked()) {
QPalette pal = m_trackLabel->palette();
......
......@@ -124,7 +124,7 @@ public:
if (rate %2 == 1) {
rate++;
}
static_cast<ProjectSortProxyModel *>(model)->updateRating(index, (uint) rate);
emit static_cast<ProjectSortProxyModel *>(model)->updateRating(index, (uint) rate);
}
}
}
......@@ -905,10 +905,10 @@ Bin::Bin(std::shared_ptr<ProjectItemModel> model, QWidget *parent)
connect(m_slider, &QAbstractSlider::valueChanged, this, &Bin::slotSetIconSize);