Commit d33d59c2 authored by Laurent Montel's avatar Laurent Montel 😁

Port some foreach to c++ for(...:...)

parent 79a0a889
......@@ -439,7 +439,7 @@ QMimeData *EffectsListWidget::mimeData(const QList<QTreeWidgetItem *> list) cons
{
QDomDocument doc;
bool transitionMode = false;
foreach (QTreeWidgetItem *item, list) {
for (QTreeWidgetItem *item : list) {
if (item->flags() & Qt::ItemIsDragEnabled) {
int type = item->data(0, TypeRole).toInt();
if (type == EffectsList::TRANSITION_TYPE) {
......
......@@ -70,7 +70,7 @@ AnalysisTree::AnalysisTree(QWidget *parent) : QTreeWidget(parent)
QMimeData *AnalysisTree::mimeData(const QList<QTreeWidgetItem *> list) const
{
QString data;
foreach (QTreeWidgetItem *item, list) {
for (QTreeWidgetItem *item : list) {
if (item->flags() & Qt::ItemIsDragEnabled) {
data.append(item->text(1));
}
......
......@@ -535,8 +535,8 @@ void Monitor::slotForceSize(QAction *a)
profileWidth = m_glMonitor->profile()->dar() * profileHeight;
if (profileWidth > r.width() * 0.8 || profileHeight > r.height() * 0.7) {
// reset action to free resize
QList< QAction * > list = m_forceSize->actions();
foreach (QAction *ac, list) {
const QList< QAction * > list = m_forceSize->actions();
for (QAction *ac : list) {
if (ac->data().toInt() == m_forceSizeFactor) {
m_forceSize->setCurrentAction(ac);
break;
......
......@@ -440,9 +440,9 @@ void StopmotionWidget::parseExistingSequences()
QStringList filters;
filters << QStringLiteral("*_0000.png");
//dir.setNameFilters(filters);
QStringList sequences = dir.entryList(filters, QDir::Files, QDir::Name);
const QStringList sequences = dir.entryList(filters, QDir::Files, QDir::Name);
////qCDebug(KDENLIVE_LOG)<<"PF: "<<<<", sm: "<<sequences;
foreach (const QString &sequencename, sequences) {
for (const QString &sequencename : sequences) {
sequence_name->addItem(sequencename.section(QLatin1Char('_'), 0, -2));
}
}
......
......@@ -1961,7 +1961,7 @@ bool ClipItem::updateNormalKeyframes(QDomElement parameter, const ItemInfo &oldI
const QStringList data = parameter.attribute(QStringLiteral("keyframes")).split(QLatin1Char(';'), QString::SkipEmptyParts);
QMap<int, double> keyframes;
foreach (const QString &keyframe, data) {
for (const QString &keyframe : data) {
int keyframepos = keyframe.section(QLatin1Char('='), 0, 0).toInt();
// if keyframe was at clip start, update it
if (keyframepos == oldin) {
......
......@@ -116,8 +116,8 @@ void ThemeManager::setCurrentTheme(const QString &filename)
return;
}
QString name = d->themeMap.key(filename, d->defaultThemeName);
QList<QAction *> list = d->themeMenuActionGroup->actions();
foreach (QAction *const action, list) {
const QList<QAction *> list = d->themeMenuActionGroup->actions();
for (QAction *const action : list) {
if (action->text().remove('&') == name) {
action->setChecked(true);
//slotChangePalette();
......@@ -227,9 +227,9 @@ void ThemeManager::slotConfigColors()
void ThemeManager::updateCurrentKDEdefaultThemePreview()
{
QList<QAction *> list = d->themeMenuActionGroup->actions();
const QList<QAction *> list = d->themeMenuActionGroup->actions();
foreach (QAction *const action, list) {
for (QAction *const action : list) {
if (action->text().remove('&') == defaultThemeName()) {
KSharedConfigPtr config = KSharedConfig::openConfig(d->themeMap.value(currentKDEdefaultTheme()));
QIcon icon = createSchemePreviewIcon(config);
......
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