Commit 7ba3ff0b authored by Vincent Pinon's avatar Vincent Pinon
Browse files

Fix clang-tidy / clazy warnings

parent bff5ba5b
...@@ -149,10 +149,10 @@ int main(int argc, char **argv) ...@@ -149,10 +149,10 @@ int main(int argc, char **argv)
LocaleHandling::resetAllLocale(); LocaleHandling::resetAllLocale();
auto *rJob = new RenderJob(render, playlist, target, pid, in, out, qApp); auto *rJob = new RenderJob(render, playlist, target, pid, in, out, qApp);
rJob->start(); rJob->start();
QObject::connect(rJob, &RenderJob::renderingFinished, [&, rJob]() { QObject::connect(rJob, &RenderJob::renderingFinished, rJob, [&, rJob]() {
rJob->deleteLater(); rJob->deleteLater();
app.quit(); app.quit();
}); });
return app.exec(); return app.exec();
} else { } else {
fprintf(stderr, fprintf(stderr,
......
...@@ -247,9 +247,9 @@ bool KeyframeModelList::updateKeyframe(GenTime pos, const QVariant &value, const ...@@ -247,9 +247,9 @@ bool KeyframeModelList::updateKeyframe(GenTime pos, const QVariant &value, const
auto *command = new AssetKeyframeCommand(ptr, index, value, pos, parentCommand); auto *command = new AssetKeyframeCommand(ptr, index, value, pos, parentCommand);
if (parentCommand == nullptr) { if (parentCommand == nullptr) {
pCore->pushUndo(command); pCore->pushUndo(command);
} } // clang-tidy: else "command" is leaked? no because is was pushed to parentCommand
} }
return true; return true; // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
} }
bool KeyframeModelList::updateKeyframeType(GenTime pos, int type, const QPersistentModelIndex &index) bool KeyframeModelList::updateKeyframeType(GenTime pos, int type, const QPersistentModelIndex &index)
......
...@@ -52,7 +52,7 @@ GeometryEditWidget::GeometryEditWidget(std::shared_ptr<AssetParameterModel> mode ...@@ -52,7 +52,7 @@ GeometryEditWidget::GeometryEditWidget(std::shared_ptr<AssetParameterModel> mode
m_geom = new GeometryWidget(monitor, QPair<int, int>(start, end), rect, 100, frameSize, false, m_geom = new GeometryWidget(monitor, QPair<int, int>(start, end), rect, 100, frameSize, false,
m_model->data(m_index, AssetParameterModel::OpacityRole).toBool(), true, this); m_model->data(m_index, AssetParameterModel::OpacityRole).toBool(), true, this);
m_geom->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred)); m_geom->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred));
connect(m_geom, &GeometryWidget::updateMonitorGeometry, [this](const QRect r) { connect(m_geom, &GeometryWidget::updateMonitorGeometry, this, [this](const QRect r) {
if (m_model->isActive()) { if (m_model->isActive()) {
pCore->getMonitor(m_model->monitorId)->setUpEffectGeometry(r); pCore->getMonitor(m_model->monitorId)->setUpEffectGeometry(r);
} }
......
...@@ -217,7 +217,7 @@ KeyframeWidget::KeyframeWidget(std::shared_ptr<AssetParameterModel> model, QMode ...@@ -217,7 +217,7 @@ KeyframeWidget::KeyframeWidget(std::shared_ptr<AssetParameterModel> model, QMode
connect(m_buttonNext, &QAbstractButton::pressed, m_keyframeview, &KeyframeView::slotGoToNext); connect(m_buttonNext, &QAbstractButton::pressed, m_keyframeview, &KeyframeView::slotGoToNext);
connect(m_buttonCenter, &QAbstractButton::pressed, m_keyframeview, &KeyframeView::slotCenterKeyframe); connect(m_buttonCenter, &QAbstractButton::pressed, m_keyframeview, &KeyframeView::slotCenterKeyframe);
connect(m_buttonCopy, &QAbstractButton::pressed, m_keyframeview, &KeyframeView::slotDuplicateKeyframe); connect(m_buttonCopy, &QAbstractButton::pressed, m_keyframeview, &KeyframeView::slotDuplicateKeyframe);
connect(m_buttonApply, &QAbstractButton::pressed, [this]() { connect(m_buttonApply, &QAbstractButton::pressed, this, [this]() {
QMultiMap<QPersistentModelIndex, QString> paramList; QMultiMap<QPersistentModelIndex, QString> paramList;
QList<QPersistentModelIndex> rectParams; QList<QPersistentModelIndex> rectParams;
for (const auto &w : m_parameters) { for (const auto &w : m_parameters) {
...@@ -477,7 +477,7 @@ void KeyframeWidget::addParameter(const QPersistentModelIndex &index) ...@@ -477,7 +477,7 @@ void KeyframeWidget::addParameter(const QPersistentModelIndex &index)
this, [this, index](const QString v) { this, [this, index](const QString v) {
emit activateEffect(); emit activateEffect();
m_keyframes->updateKeyframe(GenTime(getPosition(), pCore->getCurrentFps()), QVariant(v), index); }); m_keyframes->updateKeyframe(GenTime(getPosition(), pCore->getCurrentFps()), QVariant(v), index); });
connect(geomWidget, &GeometryWidget::updateMonitorGeometry, [this](const QRect r) { connect(geomWidget, &GeometryWidget::updateMonitorGeometry, this, [this](const QRect r) {
if (m_model->isActive()) { if (m_model->isActive()) {
pCore->getMonitor(m_model->monitorId)->setUpEffectGeometry(r); pCore->getMonitor(m_model->monitorId)->setUpEffectGeometry(r);
} }
......
...@@ -218,7 +218,7 @@ QList<int> TimelineModel::getTracksIds(bool audio) const ...@@ -218,7 +218,7 @@ QList<int> TimelineModel::getTracksIds(bool audio) const
int TimelineModel::getTrackIndexFromPosition(int pos) const int TimelineModel::getTrackIndexFromPosition(int pos) const
{ {
Q_ASSERT(pos >= 0 && pos < m_allTracks.size()); Q_ASSERT(pos >= 0 && pos < int(m_allTracks.size()));
READ_LOCK(); READ_LOCK();
auto it = m_allTracks.cbegin(); auto it = m_allTracks.cbegin();
while (pos > 0) { while (pos > 0) {
......
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