Commit a71dddba authored by Vincent Pinon's avatar Vincent Pinon
Browse files

Apply clazy fixes (range-loop)

parent 6199a1de
Pipeline #27849 passed with stage
in 25 minutes and 21 seconds
......@@ -90,7 +90,7 @@ int main(int argc, char **argv)
}
const char *localename = prod.get_lcnumeric();
QLocale::setDefault(QLocale(localename));
for (const QString &frame : chunks) {
for (const QString &frame : qAsConst(chunks)) {
fprintf(stderr, "START:%d \n", frame.toInt());
QString fileName = QStringLiteral("%1.%2").arg(frame).arg(extension);
if (baseFolder.exists(fileName)) {
......@@ -101,7 +101,7 @@ int main(int argc, char **argv)
QScopedPointer<Mlt::Producer> playlst(prod.cut(frame.toInt(), frame.toInt() + chunkSize));
QScopedPointer<Mlt::Consumer> cons(
new Mlt::Consumer(profile, QString("avformat:%1").arg(baseFolder.absoluteFilePath(fileName)).toUtf8().constData()));
for (const QString &param : consumerParams) {
for (const QString &param : qAsConst(consumerParams)) {
if (param.contains(QLatin1Char('='))) {
cons->set(param.section(QLatin1Char('='), 0, 0).toUtf8().constData(), param.section(QLatin1Char('='), 1).toUtf8().constData());
}
......
......@@ -85,7 +85,7 @@ template <typename AssetType> void AbstractAssetsRepository<AssetType>::init()
QDir current_dir(dir);
QStringList filter {QStringLiteral("*.xml")};
QStringList fileList = current_dir.entryList(filter, QDir::Files);
for (const auto &file : fileList) {
for (const auto &file : qAsConst(fileList)) {
QString path = current_dir.absoluteFilePath(file);
parseCustomAssetFile(path, customAssets);
}
......
......@@ -65,7 +65,7 @@ AssetPanel::AssetPanel(QWidget *parent)
m_switchCompoButton = new QComboBox(this);
m_switchCompoButton->setFrame(false);
auto allTransitions = TransitionsRepository::get()->getNames();
for (const auto &transition : allTransitions) {
for (const auto &transition : qAsConst(allTransitions)) {
m_switchCompoButton->addItem(transition.second, transition.first);
}
connect(m_switchCompoButton, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), [&]() {
......
......@@ -53,7 +53,7 @@ void CornersHelper::refreshParams(int pos)
QVariantList points{QPointF(), QPointF(), QPointF(), QPointF()};
QList<double> coords;
QSize frameSize = pCore->getCurrentFrameSize();
for (const auto &ix : m_indexes) {
for (const auto &ix : qAsConst(m_indexes)) {
auto type = m_model->data(ix, AssetParameterModel::TypeRole).value<ParamType>();
if (type != ParamType::KeyframeParam) {
continue;
......
......@@ -236,7 +236,7 @@ bool KeyframeModel::offsetKeyframes(int oldPos, int pos, bool logUndo)
times << m.first;
}
bool res = true;
for (const auto &t : times) {
for (const auto &t : qAsConst(times)) {
res &= moveKeyframe(t, t + diff, QVariant(), undo, redo);
}
if (res && logUndo) {
......
......@@ -363,7 +363,7 @@ void KeyframeModelList::resizeKeyframes(int oldIn, int oldOut, int in, int out,
QVariant value = param.second->getInterpolatedValue(new_in);
param.second->updateKeyframe(old_in, value, undo, redo);
}
for (auto frame : positions) {
for (auto frame : qAsConst(positions)) {
if (new_in > GenTime()) {
if (frame > new_in) {
param.second->moveKeyframe(frame, frame - new_in, QVariant(), undo, redo);
......@@ -455,7 +455,7 @@ void KeyframeModelList::resizeKeyframes(int oldIn, int oldOut, int in, int out,
for (const auto &param : m_parameters) {
QVariant value = param.second->getInterpolatedValue(new_out);
param.second->addKeyframe(new_out, type, value, true, undo, redo);
for (auto frame : positions) {
for (auto frame : qAsConst(positions)) {
param.second->removeKeyframe(frame, undo, redo);
}
}
......
......@@ -60,7 +60,7 @@ void KeyframeMonitorHelper::refreshParams(int /* pos */ )
QVariantList points;
QVariantList types;
std::shared_ptr<KeyframeModelList> keyframes = m_model->getKeyframeModel();
for (const auto &ix : m_indexes) {
for (const auto &ix : qAsConst(m_indexes)) {
auto type = m_model->data(ix, AssetParameterModel::TypeRole).value<ParamType>();
if (type != ParamType::AnimatedRect) {
continue;
......@@ -96,7 +96,7 @@ void KeyframeMonitorHelper::slotUpdateFromMonitorData(const QVariantList &center
qDebug() << "* * * *CENTER POINTS MISMATCH, aborting edit";
return;
}
for (const auto &ix : m_indexes) {
for (const auto &ix : qAsConst(m_indexes)) {
auto type = m_model->data(ix, AssetParameterModel::TypeRole).value<ParamType>();
if (type != ParamType::AnimatedRect) {
continue;
......
......@@ -65,7 +65,7 @@ void RotoHelper::refreshParams(int pos)
if (!keyframes->isEmpty()) {
QVariant splineData = keyframes->getInterpolatedValue(pos, m_indexes.first());
QList<BPoint> p = getPoints(splineData, pCore->getCurrentFrameSize());
for (const auto &i : p) {
for (const auto &i : qAsConst(p)) {
centerPoints << QVariant(i.p);
controlPoints << QVariant(i.h1);
controlPoints << QVariant(i.h2);
......
......@@ -87,7 +87,7 @@ AssetMultiCommand::AssetMultiCommand(const std::shared_ptr<AssetParameterModel>
} else if (TransitionsRepository::get()->exists(id)) {
setText(i18n("Edit %1", TransitionsRepository::get()->getName(id)));
}
for (QModelIndex ix : m_indexes) {
for (QModelIndex ix : qAsConst(m_indexes)) {
QVariant previousVal = m_model->data(ix, AssetParameterModel::ValueRole);
m_oldValues << previousVal.toString();
}
......@@ -97,7 +97,7 @@ void AssetMultiCommand::undo()
{
int indx = 0;
int max = m_indexes.size() - 1;
for (const QModelIndex &ix : m_indexes) {
for (const QModelIndex &ix : qAsConst(m_indexes)) {
m_model->setParameter(m_model->data(ix, AssetParameterModel::NameRole).toString(), m_oldValues.at(indx), indx == max, ix);
indx++;
}
......@@ -107,7 +107,7 @@ void AssetMultiCommand::redo()
{
int indx = 0;
int max = m_indexes.size() - 1;
for (const QModelIndex &ix : m_indexes) {
for (const QModelIndex &ix : qAsConst(m_indexes)) {
m_model->setParameter(m_model->data(ix, AssetParameterModel::NameRole).toString(), m_values.at(indx), m_updateView && indx == max, ix);
indx++;
}
......
......@@ -224,7 +224,7 @@ void AssetParameterModel::prepareKeyframes()
{
if (m_keyframes) return;
int ix = 0;
for (const auto &name : m_rows) {
for (const auto &name : qAsConst(m_rows)) {
if (m_params.at(name).type == ParamType::KeyframeParam || m_params.at(name).type == ParamType::AnimatedRect ||
m_params.at(name).type == ParamType::Roto_spline) {
addKeyframeParam(index(ix, 0));
......@@ -769,7 +769,7 @@ void AssetParameterModel::deletePreset(const QString &presetFile, const QString
toDelete << i;
}
}
for (int i : toDelete) {
for (int i : qAsConst(toDelete)) {
array.removeAt(i);
}
} else if (loadDoc.isObject()) {
......@@ -819,7 +819,7 @@ void AssetParameterModel::savePreset(const QString &presetFile, const QString &p
toDelete << i;
}
}
for (int i : toDelete) {
for (int i : qAsConst(toDelete)) {
array.removeAt(i);
}
} else if (loadDoc.isObject()) {
......
......@@ -73,7 +73,7 @@ void AssetParameterView::setModel(const std::shared_ptr<AssetParameterModel> &mo
updatePreset->setEnabled(false);
deletePreset->setEnabled(false);
}
for (const QString &pName : presets) {
for (const QString &pName : qAsConst(presets)) {
QAction *ac = m_presetMenu->addAction(pName, this, SLOT(slotLoadPreset()));
m_presetGroup->addAction(ac);
ac->setData(pName);
......
......@@ -56,7 +56,7 @@ ButtonParamWidget::ButtonParamWidget(std::shared_ptr<AssetParameterModel> model,
#endif
QString conditionalInfo;
for (const QVariant &jobElement : filterData) {
for (const QVariant &jobElement : qAsConst(filterData)) {
QStringList d = jobElement.toStringList();
if (d.size() == 2) {
if (d.at(0) == QLatin1String("conditionalinfo")) {
......@@ -68,7 +68,7 @@ ButtonParamWidget::ButtonParamWidget(std::shared_ptr<AssetParameterModel> model,
}
QVector<QPair<QString, QVariant>> filterParams = m_model->getAllParameters();
m_displayConditional = true;
for (const auto &param : filterParams) {
for (const auto &param : qAsConst(filterParams)) {
if (param.first == m_keyParam) {
if (!param.second.toString().isEmpty()) {
m_displayConditional = false;
......@@ -123,7 +123,7 @@ ButtonParamWidget::ButtonParamWidget(std::shared_ptr<AssetParameterModel> model,
if (d.size() == 2)
fData.insert({d.at(0), d.at(1)});
}
for (const auto &param : filterLastParams) {
for (const auto &param : qAsConst(filterLastParams)) {
if (param.first != m_keyParam) {
fParams.insert({param.first, param.second});
}
......@@ -153,7 +153,7 @@ void ButtonParamWidget::slotRefresh()
{
QVector<QPair<QString, QVariant>> filterParams = m_model->getAllParameters();
m_displayConditional = true;
for (const auto &param : filterParams) {
for (const auto &param : qAsConst(filterParams)) {
if (param.first == m_keyParam && !param.second.isNull()) {
m_displayConditional = false;
break;
......
......@@ -404,7 +404,7 @@ void KisCubicCurve::removePoint(int idx)
const QString KisCubicCurve::toString() const
{
QString sCurve;
for (const QPointF &pair : d->data->points) {
for (const QPointF &pair : qAsConst(d->data->points)) {
sCurve += QString::number(pair.x());
sCurve += QStringLiteral("/");
sCurve += QString::number(pair.y());
......
......@@ -104,7 +104,7 @@ KeyframeImport::KeyframeImport(const QString &animData, std::shared_ptr<AssetPar
}
auto list = json.array();
int ix = 0;
for (const auto &entry : list) {
for (const auto &entry : qAsConst(list)) {
if (!entry.isObject()) {
qDebug() << "Warning : Skipping invalid marker data";
continue;
......@@ -648,7 +648,7 @@ void KeyframeImport::importSelectedData()
int finalAlign = m_alignCombo->currentIndex();
QLocale locale; // Import from clipboard – OK to use locale here?
locale.setNumberOptions(QLocale::OmitGroupSeparator);
for (const auto &ix : m_indexes) {
for (const auto &ix : qAsConst(m_indexes)) {
// update keyframes in other indexes
KeyframeModel *km = kfrModel->getKeyModel(ix);
qDebug()<<"== "<<ix<<" = "<<m_targetCombo->currentData().toModelIndex();
......
......@@ -39,7 +39,7 @@ KeywordParamWidget::KeywordParamWidget(std::shared_ptr<AssetParameterModel> mode
QStringList kwrdNames = m_model->data(m_index, AssetParameterModel::ListNamesRole).toStringList();
comboboxwidget->addItems(kwrdNames);
int i = 0;
for (const QString &keywordVal : kwrdValues) {
for (const QString &keywordVal : qAsConst(kwrdValues)) {
if (i >= comboboxwidget->count()) {
break;
}
......
......@@ -83,7 +83,7 @@ void MixerManager::registerTrack(int tid, std::shared_ptr<Mlt::Tractor> service,
connect(mixer.get(), &MixerWidget::toggleSolo, [&](int trid, bool solo) {
if (!solo) {
// unmute
for (int id : m_soloMuted) {
for (int id : qAsConst(m_soloMuted)) {
if (m_mixers.count(id) > 0) {
m_model->setTrackProperty(id, "hide", QStringLiteral("1"));
}
......@@ -92,14 +92,14 @@ void MixerManager::registerTrack(int tid, std::shared_ptr<Mlt::Tractor> service,
} else {
if (!m_soloMuted.isEmpty()) {
// Another track was solo, discard first
for (int id : m_soloMuted) {
for (int id : qAsConst(m_soloMuted)) {
if (m_mixers.count(id) > 0) {
m_model->setTrackProperty(id, "hide", QStringLiteral("1"));
}
}
m_soloMuted.clear();
}
for (auto item : m_mixers) {
for (const auto &item : m_mixers) {
if (item.first != trid && !item.second->isMute()) {
m_model->setTrackProperty(item.first, "hide", QStringLiteral("3"));
m_soloMuted << item.first;
......@@ -184,7 +184,7 @@ void MixerManager::recordStateChanged(int tid, bool recording)
void MixerManager::connectMixer(bool doConnect)
{
m_visibleMixerManager = doConnect;
for (auto item : m_mixers) {
for (const auto &item : m_mixers) {
item.second->connectMixer(m_visibleMixerManager && !KdenliveSettings::mixerCollapse());
}
if (m_masterMixer != nullptr) {
......@@ -222,7 +222,7 @@ QSize MixerManager::sizeHint() const
void MixerManager::pauseMonitoring(bool pause)
{
for (auto item : m_mixers) {
for (const auto &item : m_mixers) {
item.second->pauseMonitoring(pause);
}
if (m_masterMixer != nullptr) {
......
......@@ -260,7 +260,7 @@ public:
QRectF tagRect = m_thumbRect.adjusted(2, 2, 0, 2);
tagRect.setWidth(r1.height() / 3.5);
tagRect.setHeight(tagRect.width());
for (const QString &color : t) {
for (const QString &color : qAsConst(t)) {
painter->setBrush(QColor(color));
painter->drawRoundedRect(tagRect, tagRect.height() / 2, tagRect.height() / 2);
tagRect.moveTop(tagRect.bottom() + tagRect.height() / 4);
......@@ -439,7 +439,7 @@ public:
QRectF tagRect = m_thumbRect.adjusted(2, 2, 0, 2);
tagRect.setWidth(m_thumbRect.height() / 5);
tagRect.setHeight(tagRect.width());
for (const QString &color : t) {
for (const QString &color : qAsConst(t)) {
painter->setBrush(QColor(color));
painter->drawRoundedRect(tagRect, tagRect.height() / 2, tagRect.height() / 2);
tagRect.moveTop(tagRect.bottom() + tagRect.height() / 4);
......@@ -1082,7 +1082,7 @@ Bin::Bin(std::shared_ptr<ProjectItemModel> model, QWidget *parent)
int rateFilters = 0;
int typeFilters = 0;
QStringList tagFilters;
for (QAction *ac : list) {
for (QAction *ac : qAsConst(list)) {
if (ac->isChecked()) {
QString actionData = ac->data().toString();
if (actionData.startsWith(QLatin1Char('#'))) {
......@@ -1096,7 +1096,7 @@ Bin::Bin(std::shared_ptr<ProjectItemModel> model, QWidget *parent)
}
// Type actions
list = m_filterTypeGroup.actions();
for (QAction *ac : list) {
for (QAction *ac : qAsConst(list)) {
if (ac->isChecked()) {
typeFilters = ac->data().toInt();
break;
......@@ -1117,7 +1117,7 @@ Bin::Bin(std::shared_ptr<ProjectItemModel> model, QWidget *parent)
QSignalBlocker bk(m_filterMenu);
QList<QAction *> list = m_filterMenu->actions();
list << m_filterTypeGroup.actions();
for (QAction *ac : list) {
for (QAction *ac : qAsConst(list)) {
ac->setChecked(false);
}
m_proxyModel->slotClearSearchFilters();
......@@ -1128,7 +1128,7 @@ Bin::Bin(std::shared_ptr<ProjectItemModel> model, QWidget *parent)
int rateFilters = 0;
int typeFilters = 0;
QStringList tagFilters;
for (QAction *ac : list) {
for (QAction *ac : qAsConst(list)) {
if (ac->isChecked()) {
QString actionData = ac->data().toString();
if (actionData.startsWith(QLatin1Char('#'))) {
......@@ -1142,7 +1142,7 @@ Bin::Bin(std::shared_ptr<ProjectItemModel> model, QWidget *parent)
}
// Type actions
list = m_filterTypeGroup.actions();
for (QAction *ac : list) {
for (QAction *ac : qAsConst(list)) {
if (ac->isChecked()) {
typeFilters = ac->data().toInt();
break;
......@@ -1606,7 +1606,7 @@ void Bin::slotDuplicateClip()
items << m_itemModel->getBinItemByIndex(m_proxyModel->mapToSource(ix));
}
QString lastId;
for (auto item : items) {
for (const auto &item : qAsConst(items)) {
if (item->itemType() == AbstractProjectItem::ClipItem) {
auto currentItem = std::static_pointer_cast<ProjectClip>(item);
if (currentItem) {
......@@ -2144,7 +2144,7 @@ void Bin::slotInitView(QAction *action)
QSignalBlocker bk2(m_sortGroup);
m_sortDescend->setChecked(order == Qt::DescendingOrder);
QList <QAction*> actions = m_sortGroup->actions();
for (auto ac : actions) {
for (auto ac : qAsConst(actions)) {
if (ac->data().toInt() == ix) {
ac->setChecked(true);
break;
......@@ -2984,7 +2984,7 @@ void Bin::slotItemDropped(const QStringList &ids, const QModelIndex &parent)
}
}
if (!folderIds.isEmpty()) {
for (QString id : folderIds) {
for (QString id : qAsConst(folderIds)) {
id.remove(0, 1);
std::shared_ptr<ProjectFolder> currentItem = m_itemModel->getFolderByBinId(id);
if (!currentItem) {
......@@ -3873,7 +3873,7 @@ void Bin::refreshProxySettings()
m_doc->slotProxyCurrentItem(false, clipList, false, masterCommand);
} else {
QList<std::shared_ptr<ProjectClip>> toProxy;
for (const std::shared_ptr<ProjectClip> &clp : clipList) {
for (const std::shared_ptr<ProjectClip> &clp : qAsConst(clipList)) {
ClipType::ProducerType t = clp->clipType();
if (t == ClipType::Playlist) {
toProxy << clp;
......@@ -3904,7 +3904,7 @@ QStringList Bin::getProxyHashList()
{
QStringList list;
QList<std::shared_ptr<ProjectClip>> clipList = m_itemModel->getRootFolder()->childClips();
for (const std::shared_ptr<ProjectClip> &clp : clipList) {
for (const std::shared_ptr<ProjectClip> &clp : qAsConst(clipList)) {
if (clp->clipType() == ClipType::AV || clp->clipType() == ClipType::Video || clp->clipType() == ClipType::Playlist) {
list << clp->hash();
}
......@@ -3927,7 +3927,7 @@ void Bin::reloadAllProducers(bool reloadThumbs)
}
QList<std::shared_ptr<ProjectClip>> clipList = m_itemModel->getRootFolder()->childClips();
emit openClip(std::shared_ptr<ProjectClip>());
for (const std::shared_ptr<ProjectClip> &clip : clipList) {
for (const std::shared_ptr<ProjectClip> &clip : qAsConst(clipList)) {
QDomDocument doc;
QDomElement xml = clip->toXml(doc, false, false);
// Make sure we reload clip length
......@@ -3960,7 +3960,7 @@ void Bin::checkAudioThumbs()
return;
}
QList<std::shared_ptr<ProjectClip>> clipList = m_itemModel->getRootFolder()->childClips();
for (auto clip : clipList) {
for (const auto &clip : qAsConst(clipList)) {
ClipType::ProducerType type = clip->clipType();
if (type == ClipType::AV || type == ClipType::Audio || type == ClipType::Playlist || type == ClipType::Unknown) {
pCore->jobManager()->startJob<AudioThumbJob>({clip->clipId()}, -1, QString());
......@@ -3984,7 +3984,7 @@ void Bin::resetUsageCount()
void Bin::getBinStats(uint *used, uint *unused, qint64 *usedSize, qint64 *unusedSize)
{
QList<std::shared_ptr<ProjectClip>> clipList = m_itemModel->getRootFolder()->childClips();
for (const std::shared_ptr<ProjectClip> &clip : clipList) {
for (const std::shared_ptr<ProjectClip> &clip : qAsConst(clipList)) {
if (clip->refCount() == 0) {
*unused += 1;
*unusedSize += clip->getProducerInt64Property(QStringLiteral("kdenlive:file_size"));
......@@ -4004,7 +4004,7 @@ void Bin::rebuildProxies()
{
QList<std::shared_ptr<ProjectClip>> clipList = m_itemModel->getRootFolder()->childClips();
QList<std::shared_ptr<ProjectClip>> toProxy;
for (const std::shared_ptr<ProjectClip> &clp : clipList) {
for (const std::shared_ptr<ProjectClip> &clp : qAsConst(clipList)) {
if (clp->hasProxy()) {
toProxy << clp;
// Abort all pending jobs
......@@ -4151,7 +4151,7 @@ void Bin::invalidateClip(const QString &binId)
std::shared_ptr<ProjectClip> clip = getBinClip(binId);
if (clip && clip->clipType() != ClipType::Audio) {
QList<int> ids = clip->timelineInstances();
for (int i : ids) {
for (int i : qAsConst(ids)) {
pCore->invalidateItem({ObjectType::TimelineClip,i});
}
}
......@@ -4253,7 +4253,7 @@ void Bin::checkMissingProxies()
}
QList<std::shared_ptr<ProjectClip>> clipList = m_itemModel->getRootFolder()->childClips();
QList<std::shared_ptr<ProjectClip>> toProxy;
for (auto clip : clipList) {
for (const auto &clip : qAsConst(clipList)) {
if (clip->getProducerIntProperty(QStringLiteral("_replaceproxy")) > 0) {
clip->resetProducerProperty(QStringLiteral("_replaceproxy"));
toProxy << clip;
......@@ -4274,7 +4274,7 @@ void Bin::saveFolderState()
auto *view = static_cast<QTreeView *>(m_itemView);
QList <std::shared_ptr<ProjectFolder> > folders = m_itemModel->getFolders();
QStringList expandedFolders;
for (const auto &folder : folders) {
for (const auto &folder : qAsConst(folders)) {
QModelIndex ix = m_itemModel->getIndexFromItem(folder);
if (view->isExpanded(m_proxyModel->mapFromSource(ix))) {
// Save expanded state
......
......@@ -248,13 +248,13 @@ const QString ClipCreator::createClipsFromList(const QList<QUrl> &list, bool che
dir.setNameFilters(ClipCreationDialog::getExtensions());
QStringList result = dir.entryList(QDir::Files);
QList<QUrl> folderFiles;
for (const QString &path : result) {
for (const QString &path : qAsConst(result)) {
QUrl url = QUrl::fromLocalFile(dir.absoluteFilePath(path));
folderFiles.append(url);
}
if (folderFiles.isEmpty()) {
QList<QUrl> sublist;
for (const QString &sub : subfolders) {
for (const QString &sub : qAsConst(subfolders)) {
QUrl url = QUrl::fromLocalFile(dir.absoluteFilePath(sub));
if (!list.contains(url)) {
sublist << url;
......@@ -291,7 +291,7 @@ const QString ClipCreator::createClipsFromList(const QList<QUrl> &list, bool che
}
// Check subfolders
QList<QUrl> sublist;
for (const QString &sub : subfolders) {
for (const QString &sub : qAsConst(subfolders)) {
QUrl url = QUrl::fromLocalFile(dir.absoluteFilePath(sub));
if (!list.contains(url)) {
sublist << url;
......
......@@ -412,7 +412,7 @@ bool MarkerListModel::importFromJson(const QString &data, bool ignoreConflicts,
return false;
}
auto list = json.array();
for (const auto &entry : list) {
for (const auto &entry : qAsConst(list)) {
if (!entry.isObject()) {
qDebug() << "Warning : Skipping invalid marker data";
continue;
......
......@@ -626,7 +626,7 @@ std::shared_ptr<Mlt::Producer> ProjectClip::getTimelineProducer(int trackId, int
m_audioProducers[trackId]->set("set.test_image", 1);
if (m_streamEffects.contains(audioStream)) {
QStringList effects = m_streamEffects.value(audioStream);
for (const QString effect : effects) {
for (const QString &effect : qAsConst(effects)) {
Mlt::Filter filt(*m_audioProducers[trackId]->profile(), effect.toUtf8().constData());
if (filt.is_valid()) {
// Add stream effect markup
......@@ -1638,7 +1638,7 @@ void ProjectClip::requestAddStreamEffect(int streamIndex, const QString effectNa
QStringList readEffects = m_streamEffects.value(streamIndex);
QString oldEffect;
// Remove effect if present (parameters might have changed
for (const QString effect : readEffects) {
for (const QString &effect : qAsConst(readEffects)) {
if (effect == effectName || effect.startsWith(effectName + QStringLiteral(" "))) {
oldEffect = effect;
break;
......@@ -1667,7 +1667,7 @@ void ProjectClip::requestRemoveStreamEffect(int streamIndex, const QString effec
QStringList readEffects = m_streamEffects.value(streamIndex);
QString oldEffect = effectName;
// Remove effect if present (parameters might have changed
for (const QString effect : readEffects) {
for (const QString &effect : qAsConst(readEffects)) {
if (effect == effectName || effect.startsWith(effectName + QStringLiteral(" "))) {
oldEffect = effect;
break;
......@@ -1693,7 +1693,7 @@ void ProjectClip::addAudioStreamEffect(int streamIndex, const QString effectName
// effect has parameters
QStringList params = effectName.split(QLatin1Char(' '));
addedEffectName = params.takeFirst();
for (const QString &p : params) {
for (const QString &p : qAsConst(params)) {
QStringList paramValue = p.split(QLatin1Char('='));
if (paramValue.size() == 2) {
effectParams.insert(paramValue.at(0), paramValue.at(1));
......@@ -1706,7 +1706,7 @@ void ProjectClip::addAudioStreamEffect(int streamIndex, const QString effectName
if (m_streamEffects.contains(streamIndex)) {
QStringList readEffects = m_streamEffects.value(streamIndex);
// Remove effect if present (parameters might have changed
for (const QString effect : readEffects) {
for (const QString &effect : qAsConst(readEffects)) {
if (effect == addedEffectName || effect.startsWith(addedEffectName + QStringLiteral(" "))) {
continue;
}
......@@ -1746,7 +1746,7 @@ void ProjectClip::removeAudioStreamEffect(int streamIndex, QString effectName)
if (m_streamEffects.contains(streamIndex)) {
QStringList readEffects = m_streamEffects.value(streamIndex);
// Remove effect if present (parameters might have changed
for (const QString effect : readEffects) {
for (const QString &effect : qAsConst(readEffects)) {
if (effect == effectName || effect.startsWith(effectName + QStringLiteral(" "))) {
continue;
}
......
......@@ -537,7 +537,7 @@ void ProjectItemModel::loadSubClips(const QString &id, const QString &dataMap, F
}
int maxFrame = clip->duration().frames(pCore->getCurrentFps()) - 1;
auto list = json.array();
for (const auto &entry : list) {
for (const auto &entry : qAsConst(list)) {
if (!entry.isObject()) {
qDebug() << "Warning : Skipping invalid marker data";
continue;
......
......@@ -141,7 +141,7 @@ TagWidget::TagWidget(QWidget *parent)
void TagWidget::setTagData(const QString tagData)
{
QStringList colors = tagData.toLower().split(QLatin1Char(';'));
for (DragButton *tb : tags) {
for (DragButton *tb : qAsConst(tags)) {
const QString color = tb->tag();
tb->defaultAction()->setChecked(colors.contains(color));
}
......@@ -176,7 +176,7 @@ void TagWidget::showTagsConfig()