aboutsummaryrefslogtreecommitdiff
path: root/src/kconfig_compiler/kconfig_compiler.cpp
diff options
context:
space:
mode:
authorLaurent Montel <montel@kde.org>2019-02-26 07:04:22 +0100
committerLaurent Montel <montel@kde.org>2019-03-03 09:32:34 +0100
commit38b51667b5ba74fc5a28172e251c9ba4c0398e32 (patch)
treea4d4f25669093f82c006d21e8bf6a7dd09549810 /src/kconfig_compiler/kconfig_compiler.cpp
parent71abd4319c87d559e3079528bf7feb73fa4fd521 (diff)
downloadkconfig-38b51667b5ba74fc5a28172e251c9ba4c0398e32.tar.gz
kconfig-38b51667b5ba74fc5a28172e251c9ba4c0398e32.tar.bz2
[Kconfig] Compile without foreach
Summary: compile without foreach Test Plan: Unittest Ok as previously Reviewers: dfaure Reviewed By: dfaure Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D19326
Diffstat (limited to 'src/kconfig_compiler/kconfig_compiler.cpp')
-rw-r--r--src/kconfig_compiler/kconfig_compiler.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/kconfig_compiler/kconfig_compiler.cpp b/src/kconfig_compiler/kconfig_compiler.cpp
index f04d0bd5..da75ad94 100644
--- a/src/kconfig_compiler/kconfig_compiler.cpp
+++ b/src/kconfig_compiler/kconfig_compiler.cpp
@@ -1451,7 +1451,8 @@ QString memberMutatorBody(CfgEntry *e, const CfgConfig &cfg)
out << " ))" << (hasBody ? " {" : "") << endl;
out << " " << varExpression << " = v;" << endl;
- Q_FOREACH (const Signal &signal, e->signalList()) {
+ const auto listSignal = e->signalList();
+ for (const Signal &signal : listSignal) {
if (signal.modify) {
out << " Q_EMIT " << This << signal.name << "();" << endl;
} else {
@@ -1532,7 +1533,7 @@ void beginNamespaces(const QString &p_ns, QTextStream &p_out)
{
if (!p_ns.isEmpty()) {
const QStringList nameSpaces = p_ns.split(QStringLiteral("::"));
- foreach (const QString &ns, nameSpaces) {
+ for (const QString &ns : nameSpaces) {
p_out << "namespace " << ns << " {" << endl;
}
p_out << endl;
@@ -2075,7 +2076,7 @@ int main(int argc, char **argv)
h << " };" << dec << endl << endl;
h << " Q_SIGNALS:";
- Q_FOREACH (const Signal &signal, signalList) {
+ for (const Signal &signal : qAsConst(signalList)) {
h << endl;
if (!signal.label.isEmpty()) {
h << " /**" << endl;
@@ -2620,7 +2621,7 @@ int main(int argc, char **argv)
cpp << "{" << endl;
cpp << " const bool res = " << cfg.inherits << "::usrSave();" << endl;
cpp << " if (!res) return false;" << endl << endl;
- Q_FOREACH (const Signal &signal, signalList) {
+ for (const Signal &signal : qAsConst(signalList)) {
if (signal.modify) {
continue;
}
@@ -2665,7 +2666,7 @@ int main(int argc, char **argv)
if (!signalList.isEmpty())
cpp << endl;
- Q_FOREACH (const Signal &signal, signalList) {
+ for (const Signal &signal : qAsConst(signalList)) {
if (signal.modify) {
cpp << " if ( flags & " << signalEnumName(signal.name) << " ) {" << endl;
cpp << " Q_EMIT " << signal.name << "();" << endl;