forked from qt-creator/qt-creator
Use qAsConst with non-const Qt containers in range-loops
... in various places Change-Id: Ic6c0c1b9437a1ed402105c7a14a1f5f9454a68d4 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -578,7 +578,7 @@ void CMakeBuildSystem::updateProjectData()
|
||||
{
|
||||
QSet<QString> res;
|
||||
QStringList apps;
|
||||
for (const auto &target : m_buildTargets) {
|
||||
for (const auto &target : qAsConst(m_buildTargets)) {
|
||||
if (target.targetType == CMakeProjectManager::DynamicLibraryType) {
|
||||
res.insert(target.executable.parentDir().toString());
|
||||
apps.push_back(target.executable.toUserOutput());
|
||||
@@ -633,7 +633,7 @@ void CMakeBuildSystem::updateProjectData()
|
||||
}
|
||||
patchedConfig.append(settingFileItem);
|
||||
|
||||
for (const CMakeBuildTarget &bt : m_buildTargets) {
|
||||
for (const CMakeBuildTarget &bt : qAsConst(m_buildTargets)) {
|
||||
const QString buildKey = bt.title;
|
||||
if (ProjectNode *node = p->findNodeForBuildKey(buildKey)) {
|
||||
if (auto targetNode = dynamic_cast<CMakeTargetNode *>(node))
|
||||
|
||||
@@ -303,7 +303,7 @@ void ConfigModel::generateTree()
|
||||
|
||||
// Generate nodes for *all* prefixes
|
||||
QHash<QString, QList<Utils::TreeItem *>> prefixes;
|
||||
for (const InternalDataItem &di : m_configuration) {
|
||||
for (const InternalDataItem &di : qAsConst(m_configuration)) {
|
||||
const QString p = prefix(di.key);
|
||||
if (!prefixes.contains(p)) {
|
||||
prefixes.insert(p, {});
|
||||
|
||||
Reference in New Issue
Block a user