Commit 82eea080 authored by Vincent Pinon's avatar Vincent Pinon
Browse files

Fix clazy warnings

parent 4642f7ea
Pipeline #94437 passed with stage
in 13 minutes and 4 seconds
......@@ -96,7 +96,7 @@ void KeyframeModelList::slotUpdateModels(const QModelIndex &ix1, const QModelInd
{
// Propagate change to all keyframe models
for (const auto &param : m_parameters) {
param.second->dataChanged(ix1, ix2, roles);
emit param.second->dataChanged(ix1, ix2, roles);
}
emit modelDisplayChanged();
}
......
......@@ -245,7 +245,6 @@ void KeyframeView::slotCenterKeyframe()
Fun undo = []() { return true; };
Fun redo = []() { return true; };
int delta = m_position - (m_currentKeyframeOriginal - offset);
QVector<int>currentSelection = m_model->selectedKeyframes();
int sourcePosition = m_currentKeyframeOriginal;
QVector<int>updatedSelection;
for (int &kf : m_model->selectedKeyframes()) {
......
......@@ -210,7 +210,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()
......
......@@ -153,7 +153,6 @@ KeyframeImport::KeyframeImport(const QString &animData, std::shared_ptr<AssetPar
}
} else if (type == ParamType::Roto_spline) {
m_simpleTargets.insert(i18n("Rotoscoping shape"), idx);
QString name(m_model->data(idx, AssetParameterModel::NameRole).toString());
} else if (type == ParamType::AnimatedRect) {
m_geometryTargets.insert(m_model->data(idx, Qt::DisplayRole).toString(), idx);
}
......
......@@ -33,7 +33,7 @@ ListDependencyParamWidget::ListDependencyParamWidget(std::shared_ptr<AssetParame
// setup the comment
setToolTip(comment);
m_infoMessage->hide();
connect(m_infoMessage, &KMessageWidget::linkActivated, [this](const QString &contents) {
connect(m_infoMessage, &KMessageWidget::linkActivated, this, [this](const QString &contents) {
#if KIO_VERSION > QT_VERSION_CHECK(5, 70, 0)
auto *job = new KIO::OpenUrlJob(QUrl(contents));
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
......@@ -126,7 +126,7 @@ void ListDependencyParamWidget::checkDependencies(const QString &val)
if (fileData.first == QLatin1String("/opencvmodels")) {
m_model->setParameter(QStringLiteral("modelsfolder"), dir.absolutePath(), false);
}
for (const QString &file : fileData.second) {
for (const QString &file : qAsConst(fileData.second)) {
if (!dir.exists(file)) {
m_infoMessage->setText(m_dependencyInfos.value(val));
m_infoMessage->animatedShow();
......
......@@ -1330,7 +1330,7 @@ void Bin::abortOperations()
m_infoMessage->hide();
blockSignals(true);
if (m_propertiesPanel) {
for (QWidget *w : m_propertiesPanel->findChildren<ClipPropertiesController *>()) {
foreach (QWidget *w, m_propertiesPanel->findChildren<ClipPropertiesController *>()) {
delete w;
}
}
......@@ -1462,7 +1462,7 @@ void Bin::slotSaveHeaders()
void Bin::updateSortingAction(int ix)
{
for (QAction *ac : m_sortGroup->actions()) {
foreach (QAction *ac, m_sortGroup->actions()) {
if (ac->data().toInt() == ix) {
ac->setChecked(true);
}
......@@ -2614,7 +2614,7 @@ void Bin::setupAddClipAction(QMenu *addClipMenu, ClipType::ProducerType type, co
void Bin::showClipProperties(const std::shared_ptr<ProjectClip> &clip, bool forceRefresh)
{
if ((clip == nullptr) || !clip->statusReady()) {
for (QWidget *w : m_propertiesPanel->findChildren<ClipPropertiesController *>()) {
foreach (QWidget *w, m_propertiesPanel->findChildren<ClipPropertiesController *>()) {
delete w;
}
m_propertiesPanel->setProperty("clipId", QString());
......@@ -2629,7 +2629,7 @@ void Bin::showClipProperties(const std::shared_ptr<ProjectClip> &clip, bool forc
return;
}
// Cleanup widget for new content
for (QWidget *w : m_propertiesPanel->findChildren<ClipPropertiesController *>()) {
foreach (QWidget *w, m_propertiesPanel->findChildren<ClipPropertiesController *>()) {
delete w;
}
m_propertiesPanel->setProperty("clipId", clip->AbstractProjectItem::clipId());
......@@ -2647,7 +2647,7 @@ void Bin::showClipProperties(const std::shared_ptr<ProjectClip> &clip, bool forc
connect(panel, &ClipPropertiesController::updateClipProperties, this, &Bin::slotEditClipCommand);
connect(panel, &ClipPropertiesController::seekToFrame, m_monitor, static_cast<void (Monitor::*)(int)>(&Monitor::slotSeek));
connect(panel, &ClipPropertiesController::editClip, this, &Bin::slotEditClip);
connect(panel, SIGNAL(editAnalysis(QString, QString, QString)), this, SLOT(slotAddClipExtraData(QString, QString, QString)));
connect(panel, SIGNAL(editAnalysis(QString,QString,QString)), this, SLOT(slotAddClipExtraData(QString,QString,QString)));
lay->addWidget(panel);
}
......@@ -4013,7 +4013,7 @@ void Bin::slotRenameItem()
QWidget *widget = QApplication::focusWidget();
while ((widget != nullptr) && widget != pCore->window()) {
if (widget == pCore->bin()->clipPropertiesDock()) {
for (QWidget *w : m_propertiesPanel->findChildren<ClipPropertiesController *>()) {
foreach (QWidget *w, m_propertiesPanel->findChildren<ClipPropertiesController *>()) {
static_cast<ClipPropertiesController *>(w)->slotEditMarker();
break;
}
......@@ -4040,7 +4040,7 @@ void Bin::refreshProxySettings()
auto *masterCommand = new QUndoCommand();
masterCommand->setText(m_doc->useProxy() ? i18n("Enable proxies") : i18n("Disable proxies"));
// en/disable proxy option in clip properties
for (QWidget *w : m_propertiesPanel->findChildren<ClipPropertiesController *>()) {
foreach (QWidget *w, m_propertiesPanel->findChildren<ClipPropertiesController *>()) {
emit static_cast<ClipPropertiesController *>(w)->enableProxy(m_doc->useProxy());
}
if (!m_doc->useProxy()) {
......@@ -4395,7 +4395,7 @@ void Bin::checkProjectAudioTracks(QString clipId, int minimumTracksCount)
QAction *ac2 = new QAction(QIcon::fromTheme(QStringLiteral("document-edit")), i18n("Edit Streams"), this);
connect(ac2, &QAction::triggered, this, [this, clipId]() {
selectClipById(clipId);
for (QWidget *w : m_propertiesPanel->findChildren<ClipPropertiesController *>()) {
foreach (QWidget *w, m_propertiesPanel->findChildren<ClipPropertiesController *>()) {
if (w->parentWidget() && w->parentWidget()->parentWidget()) {
// Raise panel
w->parentWidget()->parentWidget()->show();
......
......@@ -465,7 +465,7 @@ void ClipCreationDialog::clipWidget(QDockWidget* m_DockClipWidget)
fileWidget->setCustomWidget(f);
// Required to only add file on double click and not on single click
fileWidget->setOperationMode(KFileWidget::Saving);
QObject::connect(fileWidget, &KFileWidget::accepted , [fileWidget, importseq]() {
QObject::connect(fileWidget, &KFileWidget::accepted, fileWidget, [fileWidget, importseq]() {
if (importseq->isChecked()) {
// We are importing an image sequence, abort
return;
......
......@@ -789,7 +789,7 @@ void KdenliveSettingsDialog::initDevices()
QSignalBlocker bk(m_configSdl.fullscreen_monitor);
m_configSdl.fullscreen_monitor->clear();
m_configSdl.fullscreen_monitor->addItem(i18n("auto"));
for (auto screen : qApp->screens()) {
for (const QScreen* screen : qApp->screens()) {
m_configSdl.fullscreen_monitor->addItem(QString("%1 %2 (%3)").arg(screen->manufacturer(), screen->model(), screen->name()), screen->serialNumber());
}
if (!KdenliveSettings::fullscreen_monitor().isEmpty()) {
......
......@@ -112,11 +112,11 @@ void ProxyTest::startTest()
QTemporaryFile src(QDir::temp().absoluteFilePath(QString("XXXXXX.mov")));
if (!src.open()) {
// Something went wrong
QMetaObject::invokeMethod(this, "showMessage", Qt::QueuedConnection, Q_ARG(const QString&,i18n("Cannot create temporary files")));
QMetaObject::invokeMethod(this, "showMessage", Qt::QueuedConnection, Q_ARG(QString,i18n("Cannot create temporary files")));
return;
}
m_process.reset(new QProcess());
QMetaObject::invokeMethod(this, "showMessage", Qt::QueuedConnection, Q_ARG(const QString&,i18n("Generating a 60 seconds test video %1", src.fileName())));
QMetaObject::invokeMethod(this, "showMessage", Qt::QueuedConnection, Q_ARG(QString,i18n("Generating a 60 seconds test video %1", src.fileName())));
QStringList source = {QStringLiteral("-y"),QStringLiteral("-f"),QStringLiteral("lavfi"),QStringLiteral("-i"),QStringLiteral("testsrc=duration=60:size=1920x1080:rate=25"),QStringLiteral("-c:v"),QStringLiteral("libx264"),QStringLiteral("-pix_fmt"),QStringLiteral("yuv420p"),src.fileName()};
m_process->start(KdenliveSettings::ffmpegpath(), source);
m_process->waitForStarted();
......@@ -127,14 +127,14 @@ void ProxyTest::startTest()
QMutexLocker lk(&m_locker);
k.next();
if (!k.key().isEmpty()) {
QMetaObject::invokeMethod(this, "showMessage", Qt::QueuedConnection, Q_ARG(const QString&,i18n("Processing %1", k.key())));
QMetaObject::invokeMethod(this, "showMessage", Qt::QueuedConnection, Q_ARG(QString,i18n("Processing %1", k.key())));
QString params = k.value().section(QLatin1Char(';'), 0, 0);
QString extension = k.value().section(QLatin1Char(';'), 1, 1);
// Testing vaapi support
QTemporaryFile tmp(QDir::temp().absoluteFilePath(QString("XXXXXX.%1").arg(extension)));
if (!tmp.open()) {
// Something went wrong
QMetaObject::invokeMethod(this, "showMessage", Qt::QueuedConnection, Q_ARG(const QString&,i18n("Cannot create temporary files")));
QMetaObject::invokeMethod(this, "showMessage", Qt::QueuedConnection, Q_ARG(QString,i18n("Cannot create temporary files")));
return;
}
tmp.close();
......@@ -184,13 +184,13 @@ void ProxyTest::startTest()
qDebug()<<"==== PROFILE FAILED: "<<k.key()<<" !!!!!!!!!!!!";
results << QStringList({k.key()});
}
QMetaObject::invokeMethod(this, "addAnalysis", Qt::QueuedConnection, Q_ARG(const QStringList&,results));
QMetaObject::invokeMethod(this, "addAnalysis", Qt::QueuedConnection, Q_ARG(QStringList,results));
}
if (m_closing) {
return;
}
}
QMetaObject::invokeMethod(this, "showMessage", Qt::QueuedConnection, Q_ARG(const QString&,QString()));
QMetaObject::invokeMethod(this, "showMessage", Qt::QueuedConnection, Q_ARG(QString,QString()));
}
......@@ -487,12 +487,10 @@ void RemapView::mouseMoveEvent(QMouseEvent *event)
}
} else if (m_moveKeyframeMode == TopMove) {
// Moving top keyframe
auto kfrValues = m_keyframes.values();
int realPos = qMax(m_inFrame, pos + m_inFrame);
//pos = GenTime(m_remapLink->anim_get_double("map", pos)).frames(pCore->getCurrentFps());
int delta = realPos - m_currentKeyframe.second;
// Check that the move is possible
auto selectedValues = m_selectedKeyframes.values();
QMapIterator<int, int> i(m_selectedKeyframes);
QMap<int,int>updated;
while (i.hasNext()) {
......@@ -516,7 +514,7 @@ void RemapView::mouseMoveEvent(QMouseEvent *event)
m_selectedKeyframes = updated;
slotSetPosition(pos + m_inFrame);
emit seekToPos(pos + m_inFrame, -1);
updateKeyframes(false);
emit updateKeyframes(false);
if (remapMax() > m_lastMaxDuration) {
m_lastMaxDuration = remapMax();
int maxWidth = width() - (2 * m_offset);
......@@ -1158,7 +1156,7 @@ void RemapView::updateAfterSpeed(double speed)
i.next();
m_keyframes.insert(i.key(), i.value());
}
updateKeyframes(true);
emit updateKeyframes(true);
update();
}
}
......@@ -1247,7 +1245,7 @@ void RemapView::addKeyframe()
emit selectedKf(m_currentKeyframe, {-1,-1});
}
emit atKeyframe(false, false);
updateKeyframesWithUndo(m_keyframes, m_keyframesOrigin);
emit updateKeyframesWithUndo(m_keyframes, m_keyframesOrigin);
update();
return;
}
......@@ -1290,7 +1288,7 @@ void RemapView::addKeyframe()
emit selectedKf(m_currentKeyframe, speeds, atEnd);
bool isLast = m_currentKeyframe.first == m_keyframes.firstKey() || m_currentKeyframe.first == m_keyframes.lastKey();
emit atKeyframe(true, isLast);
updateKeyframesWithUndo(m_keyframes, m_keyframesOrigin);
emit updateKeyframesWithUndo(m_keyframes, m_keyframesOrigin);
update();
}
......
......@@ -1271,7 +1271,6 @@ void DocumentChecker::fixSourceClipItem(QTreeWidgetItem *child, const QDomNodeLi
}
if (parentId == id) {
// Fix clip
QString resource = Xml::getXmlProperty(e, QStringLiteral("resource"));
QString fixedResource = child->text(1);
if (!Xml::getXmlProperty(e, QStringLiteral("kdenlive:originalurl")).isEmpty()) {
// Only set originalurl on master producer
......@@ -1472,7 +1471,7 @@ void DocumentChecker::slotDeleteSelected()
QStringList deletedLumas;
QDomNodeList playlists = m_doc.elementsByTagName(QStringLiteral("playlist"));
for (QTreeWidgetItem *child : m_ui.treeWidget->selectedItems()) {
foreach (QTreeWidgetItem *child, m_ui.treeWidget->selectedItems()) {
int id = child->data(0, statusRole).toInt();
if (id == CLIPMISSING) {
deletedIds.append(child->data(0, idRole).toString());
......@@ -1505,7 +1504,6 @@ void DocumentChecker::slotDeleteSelected()
if (!deletedIds.isEmpty()) {
QDomElement e;
QDomNodeList producers = m_doc.elementsByTagName(QStringLiteral("producer"));
QDomNode mlt = m_doc.elementsByTagName(QStringLiteral("mlt")).at(0);
for (int i = 0; i < producers.count(); ++i) {
e = producers.item(i).toElement();
if (deletedIds.contains(Xml::getXmlProperty(e, QStringLiteral("kdenlive:id")))) {
......
......@@ -68,7 +68,7 @@ std::shared_ptr<EffectItemModel> EffectItemModel::construct(std::unique_ptr<Mlt:
// multiswitch params have a composited param name, skip
QStringList names = paramName.split(QLatin1Char('\n'));
QStringList paramValues;
for (const QString &n : names) {
for (const QString &n : qAsConst(names)) {
paramValues << effect->get(n.toUtf8().constData());
}
currentParameter.setAttribute(QStringLiteral("value"), paramValues.join(QLatin1Char('\n')));
......
......@@ -243,23 +243,23 @@ CollapsibleEffectView::CollapsibleEffectView(const std::shared_ptr<EffectItemMod
connect(buttonDown, &QAbstractButton::clicked, this, &CollapsibleEffectView::slotEffectDown);
connect(buttonDel, &QAbstractButton::clicked, this, &CollapsibleEffectView::slotDeleteEffect);
for (QSpinBox *sp : findChildren<QSpinBox *>()) {
foreach (QSpinBox *sp, findChildren<QSpinBox *>()) {
sp->installEventFilter(this);
sp->setFocusPolicy(Qt::StrongFocus);
}
for (QComboBox *cb : findChildren<QComboBox *>()) {
foreach (QComboBox *cb, findChildren<QComboBox *>()) {
cb->installEventFilter(this);
cb->setFocusPolicy(Qt::StrongFocus);
}
for (QProgressBar *cb : findChildren<QProgressBar *>()) {
foreach (QProgressBar *cb, findChildren<QProgressBar *>()) {
cb->installEventFilter(this);
cb->setFocusPolicy(Qt::StrongFocus);
}
for (WheelContainer *cb : findChildren<WheelContainer *>()) {
foreach (WheelContainer *cb, findChildren<WheelContainer *>()) {
cb->installEventFilter(this);
cb->setFocusPolicy(Qt::StrongFocus);
}
for (QDoubleSpinBox *cb : findChildren<QDoubleSpinBox *>()) {
foreach (QDoubleSpinBox *cb, findChildren<QDoubleSpinBox *>()) {
cb->installEventFilter(this);
cb->setFocusPolicy(Qt::StrongFocus);
}
......
......@@ -35,7 +35,6 @@ private:
int m_thumbsCount;
int m_in;
int m_out;
bool m_thumbOnly;
std::function<void()> m_readyCallBack;
QString m_errorMessage;
void generateThumbnail(std::shared_ptr<ProjectClip>binClip);
......
......@@ -246,7 +246,7 @@ void CutTask::run()
} else {
// all ok, add clip
if (m_addToProject) {
QMetaObject::invokeMethod(pCore->window(), "addProjectClip", Qt::QueuedConnection, Q_ARG(const QString&,m_destination), Q_ARG(const QString&,folder));
QMetaObject::invokeMethod(pCore->window(), "addProjectClip", Qt::QueuedConnection, Q_ARG(QString,m_destination), Q_ARG(QString,folder));
}
}
} else {
......
......@@ -254,7 +254,7 @@ void FilterTask::run()
QString dataName = (m_filterData.find(QStringLiteral("displaydataname")) != m_filterData.end()) ? m_filterData.at(QStringLiteral("displaydataname")) : QStringLiteral("data");
auto binClip = pCore->projectItemModel()->getClipByBinID(m_binId);
if (binClip) {
QMetaObject::invokeMethod(binClip.get(), "updatedAnalysisData", Q_ARG(const QString&, dataName), Q_ARG(const QString&, resultData), Q_ARG(int, m_inPoint));
QMetaObject::invokeMethod(binClip.get(), "updatedAnalysisData", Q_ARG(QString, dataName), Q_ARG(QString, resultData), Q_ARG(int, m_inPoint));
}
//binClip->updatedAnalysisData(dataName, resultData, m_inPoint);
}
......
......@@ -61,7 +61,7 @@ void ProxyTask::run()
m_progress = 100;
pCore->taskManager.taskDone(m_owner.second, this);
QMetaObject::invokeMethod(m_object, "updateJobProgress");
QMetaObject::invokeMethod(binClip.get(), "updateProxyProducer", Qt::QueuedConnection, Q_ARG(const QString&,dest));
QMetaObject::invokeMethod(binClip.get(), "updateProxyProducer", Qt::QueuedConnection, Q_ARG(QString,dest));
return;
}
......@@ -364,7 +364,7 @@ void ProxyTask::run()
}
} else if (binClip) {
// Job successful
QMetaObject::invokeMethod(binClip.get(), "updateProxyProducer", Qt::QueuedConnection, Q_ARG(const QString&,dest));
QMetaObject::invokeMethod(binClip.get(), "updateProxyProducer", Qt::QueuedConnection, Q_ARG(QString,dest));
}
} else {
// Proxy process crashed
......
......@@ -30,7 +30,6 @@ SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
SceneSplitTask::SceneSplitTask(const ObjectId &owner, double threshold, int markersCategory, bool addSubclips, int minDuration, QObject* object)
: AbstractTask(owner, AbstractTask::ANALYSECLIPJOB, object)
, m_jobDuration(0)
, m_threshold(threshold)
, m_markersType(markersCategory)
, m_subClips(addSubclips)
, m_minInterval(minDuration)
......@@ -177,7 +176,7 @@ void SceneSplitTask::run()
ix++;
}
QJsonDocument json(list);
QMetaObject::invokeMethod(m_object, "importJsonMarkers", Q_ARG(const QString&,QString(json.toJson())));
QMetaObject::invokeMethod(m_object, "importJsonMarkers", Q_ARG(QString,QString(json.toJson())));
}
if (m_subClips) {
// Create zones
......@@ -208,7 +207,7 @@ void SceneSplitTask::run()
json.setArray(list);
if (!json.isEmpty()) {
QString dataMap(json.toJson());
QMetaObject::invokeMethod(pCore->projectItemModel().get(), "loadSubClips", Q_ARG(const QString&,QString::number(m_owner.second)), Q_ARG(const QString&,dataMap));
QMetaObject::invokeMethod(pCore->projectItemModel().get(), "loadSubClips", Q_ARG(QString,QString::number(m_owner.second)), Q_ARG(QString,dataMap));
}
}
} else {
......
......@@ -26,7 +26,6 @@ private slots:
private:
int m_jobDuration;
double m_threshold;
int m_markersType;
bool m_subClips;
int m_minInterval;
......
......@@ -237,7 +237,7 @@ void SpeedTask::run()
return;
}
QMetaObject::invokeMethod(pCore->bin(), "addProjectClipInFolder", Qt::QueuedConnection, Q_ARG(const QString&,m_destination), Q_ARG(const QString&,binClip->parent()->clipId()), Q_ARG(const QString&,m_addToFolder ? i18n("Speed Change") : QString()));
QMetaObject::invokeMethod(pCore->bin(), "addProjectClipInFolder", Qt::QueuedConnection, Q_ARG(QString,m_destination), Q_ARG(QString,binClip->parent()->clipId()), Q_ARG(QString,m_addToFolder ? i18n("Speed Change") : QString()));
return;
}
......
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