aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-04-05 21:48:17 +0200
committerMontel Laurent <[email protected]>2017-04-05 21:48:17 +0200
commitd33d59c234df16bf234da7fa72c56537b9e6648b (patch)
tree99b1761789bb04088603988c7c3f5e4537a11a16
parent79a0a88912928d0068c76f0c07072c3282b5c7e5 (diff)
Port some foreach to c++ for(...:...)
-rw-r--r--src/effectslist/effectslistwidget.cpp2
-rw-r--r--src/mltcontroller/clippropertiescontroller.cpp2
-rw-r--r--src/monitor/monitor.cpp4
-rw-r--r--src/stopmotion/stopmotion.cpp4
-rw-r--r--src/timeline/clipitem.cpp2
-rw-r--r--src/utils/thememanager.cpp8
6 files changed, 11 insertions, 11 deletions
diff --git a/src/effectslist/effectslistwidget.cpp b/src/effectslist/effectslistwidget.cpp
index 6a927c7..c25de1e 100644
--- a/src/effectslist/effectslistwidget.cpp
+++ b/src/effectslist/effectslistwidget.cpp
@@ -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) {
diff --git a/src/mltcontroller/clippropertiescontroller.cpp b/src/mltcontroller/clippropertiescontroller.cpp
index 990cf2a..5c6cd6c 100644
--- a/src/mltcontroller/clippropertiescontroller.cpp
+++ b/src/mltcontroller/clippropertiescontroller.cpp
@@ -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));
}
diff --git a/src/monitor/monitor.cpp b/src/monitor/monitor.cpp
index 58e5f00..d56fee4 100644
--- a/src/monitor/monitor.cpp
+++ b/src/monitor/monitor.cpp
@@ -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;
diff --git a/src/stopmotion/stopmotion.cpp b/src/stopmotion/stopmotion.cpp
index 2be57de..cde9420 100644
--- a/src/stopmotion/stopmotion.cpp
+++ b/src/stopmotion/stopmotion.cpp
@@ -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));
}
}
diff --git a/src/timeline/clipitem.cpp b/src/timeline/clipitem.cpp
index 0032869..5032f88 100644
--- a/src/timeline/clipitem.cpp
+++ b/src/timeline/clipitem.cpp
@@ -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) {
diff --git a/src/utils/thememanager.cpp b/src/utils/thememanager.cpp
index 403a423..06e0693 100644
--- a/src/utils/thememanager.cpp
+++ b/src/utils/thememanager.cpp
@@ -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);