diff --git a/src/libs/utils/qrcparser.cpp b/src/libs/utils/qrcparser.cpp index d05ae972036..21904d3716b 100644 --- a/src/libs/utils/qrcparser.cpp +++ b/src/libs/utils/qrcparser.cpp @@ -85,7 +85,7 @@ public: QStringList languages() const; private: static QString fixPrefix(const QString &prefix); - QStringList allUiLanguages(const QLocale *locale) const; + const QStringList allUiLanguages(const QLocale *locale) const; SMap m_resources; SMap m_files; @@ -343,8 +343,7 @@ bool QrcParserPrivate::parseFile(const QString &path, const QString &contents) QString QrcParserPrivate::firstFileAtPath(const QString &path, const QLocale &locale) const { QTC_CHECK(path.startsWith(QLatin1Char('/'))); - QStringList langs = allUiLanguages(&locale); - foreach (const QString &language, langs) { + for (const QString &language : allUiLanguages(&locale)) { if (m_languages.contains(language)) { SMap::const_iterator res = m_resources.find(language + path); if (res != m_resources.end()) @@ -358,8 +357,7 @@ void QrcParserPrivate::collectFilesAtPath(const QString &path, QStringList *file const QLocale *locale) const { QTC_CHECK(path.startsWith(QLatin1Char('/'))); - QStringList langs = allUiLanguages(locale); - foreach (const QString &language, langs) { + for (const QString &language : allUiLanguages(locale)) { if (m_languages.contains(language)) { SMap::const_iterator res = m_resources.find(language + path); if (res != m_resources.end()) @@ -373,8 +371,7 @@ bool QrcParserPrivate::hasDirAtPath(const QString &path, const QLocale *locale) { QTC_CHECK(path.startsWith(QLatin1Char('/'))); QTC_CHECK(path.endsWith(QLatin1Char('/'))); - QStringList langs = allUiLanguages(locale); - foreach (const QString &language, langs) { + for (const QString &language : allUiLanguages(locale)) { if (m_languages.contains(language)) { QString key = language + path; SMap::const_iterator res = m_resources.lowerBound(key); @@ -391,8 +388,7 @@ void QrcParserPrivate::collectFilesInPath(const QString &path, QMapcontains(resource)) results->append(resource); } @@ -463,7 +459,7 @@ QString QrcParserPrivate::fixPrefix(const QString &prefix) return result; } -QStringList QrcParserPrivate::allUiLanguages(const QLocale *locale) const +const QStringList QrcParserPrivate::allUiLanguages(const QLocale *locale) const { if (!locale) return languages();