From aac040b1881056f52c22c67dc7bb7f81f4c7a02f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 23 Apr 2012 17:01:45 +0200 Subject: [PATCH] const correctness for variables() Change-Id: Id11453ccbae3ffa32580badadada945d342d727a Reviewed-by: Mark Brand --- qmake/generators/mac/pbuilder_pbx.cpp | 4 ++-- qmake/generators/makefile.cpp | 2 +- qmake/generators/win32/msvc_vcproj.cpp | 4 ++-- qmake/meta.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index b1b4c43..c967e18 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -168,8 +168,8 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t) if(tmp_proj.read(fn)) { if(Option::debug_level) { debug_msg(1, "Dumping all variables:"); - QHash &vars = tmp_proj.variables(); - for(QHash::Iterator it = vars.begin(); + const QHash &vars = tmp_proj.variables(); + for (QHash::ConstIterator it = vars.begin(); it != vars.end(); ++it) { if(it.key().left(1) != "." && !it.value().isEmpty()) debug_msg(1, "%s: %s === %s", fn.toLatin1().constData(), it.key().toLatin1().constData(), diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index cfa84fd..c4e0a4f 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -317,7 +317,7 @@ QStringList MakefileGenerator::findFilesInVPATH(QStringList l, uchar flags, const QString &vpath_var) { QStringList vpath; - QHash &v = project->variables(); + const QHash &v = project->variables(); for(int val_it = 0; val_it < l.count(); ) { bool remove_file = false; QString &val = l[val_it]; diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 92daed0..2162841 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -485,8 +485,8 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) Option::output_dir = old_output_dir; if(Option::debug_level) { debug_msg(1, "Dumping all variables:"); - QHash &vars = tmp_proj.variables(); - for(QHash::Iterator it = vars.begin(); + const QHash &vars = tmp_proj.variables(); + for (QHash::ConstIterator it = vars.begin(); it != vars.end(); ++it) { if(it.key().left(1) != "." && !it.value().isEmpty()) debug_msg(1, "%s: %s === %s", fn.toLatin1().constData(), it.key().toLatin1().constData(), diff --git a/qmake/meta.cpp b/qmake/meta.cpp index ecd78e3..5577ded 100644 --- a/qmake/meta.cpp +++ b/qmake/meta.cpp @@ -142,8 +142,8 @@ QMakeMetaInfo::readLibtoolFile(const QString &f) dirf = ""; else if(!dirf.isEmpty() && !dirf.endsWith(Option::output_dir)) dirf += QLatin1Char('/'); - QHash &v = proj.variables(); - for(QHash::Iterator it = v.begin(); it != v.end(); ++it) { + const QHash &v = proj.variables(); + for (QHash::ConstIterator it = v.begin(); it != v.end(); ++it) { QStringList lst = it.value(); if(lst.count() == 1 && (lst.first().startsWith("'") || lst.first().startsWith("\"")) && lst.first().endsWith(QString(lst.first()[0]))) -- 2.7.4