summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2014-11-27 14:49:16 +0100
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-02-02 11:14:43 +0000
commit4b486cb88c410a006fb528794709ea40dc77ec53 (patch)
tree1ea3833022199a49c300f2df456e9ee4038c923d /qmake
parent365eb897130708c3f413f87a866c0240c9c6fb34 (diff)
values(foo).first() => first(foo)
Change-Id: Ic5bb8ae3166c76299881970f83d20206bec704bc Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp12
-rw-r--r--qmake/generators/makefile.cpp6
-rw-r--r--qmake/generators/unix/unixmake.cpp18
-rw-r--r--qmake/generators/unix/unixmake2.cpp20
-rw-r--r--qmake/generators/win32/winmakefile.cpp10
5 files changed, 31 insertions, 35 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index 3605a9b148..60625a115d 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -307,7 +307,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
ProString name = l.at(i);
const ProKey buildKey(name + ".build");
if (!project->isEmpty(buildKey)) {
- const QString build = project->values(buildKey).first().toQString();
+ const QString build = project->first(buildKey).toQString();
if (build.toLower() != configName.toLower())
continue;
}
@@ -344,7 +344,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
t << "\t\t" << keyFor("QMAKE_SUBDIR_PBX_AGGREGATE_TARGET") << " = {\n"
<< "\t\t\t" << writeSettings("buildPhases", ProStringList(), SettingsAsList, 4) << ";\n"
<< "\t\t\tbuildSettings = {\n"
- << "\t\t\t\t" << writeSettings("PRODUCT_NAME", project->values("TARGET").first()) << ";\n"
+ << "\t\t\t\t" << writeSettings("PRODUCT_NAME", project->first("TARGET")) << ";\n"
<< "\t\t\t};\n";
{
ProStringList dependencies;
@@ -354,8 +354,8 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
t << "\t\t\t" << writeSettings("dependencies", dependencies, SettingsAsList, 4) << ";\n"
}
t << "\t\t\t" << writeSettings("isa", "PBXAggregateTarget", SettingsNoQuote) << ";\n"
- << "\t\t\t" << writeSettings("name", project->values("TARGET").first()) << ";\n"
- << "\t\t\t" << writeSettings("productName", project->values("TARGET").first()) << ";\n"
+ << "\t\t\t" << writeSettings("name", project->first("TARGET")) << ";\n"
+ << "\t\t\t" << writeSettings("productName", project->first("TARGET")) << ";\n"
<< "\t\t};\n";
#endif
@@ -1361,14 +1361,14 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
ProString name = l.at(i);
const ProKey buildKey(name + ".build");
if (!project->isEmpty(buildKey)) {
- const QString build = project->values(buildKey).first().toQString();
+ const QString build = project->first(buildKey).toQString();
if (build.toLower() != configName.toLower())
continue;
}
const QString value = project->values(ProKey(name + ".value")).join(QString(Option::field_sep));
const ProKey nkey(name + ".name");
if (!project->isEmpty(nkey))
- name = project->values(nkey).first();
+ name = project->first(nkey);
settings.insert(name.toQString(), value);
}
}
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index f86fd62da4..d2b11aaa01 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -710,7 +710,7 @@ MakefileGenerator::init()
const ProKey ikey(*it + ".input");
const ProKey vokey(*it + ".variable_out");
const ProStringList &config = project->values(ProKey(*it + ".CONFIG"));
- const ProString &tmp_out = project->values(ProKey(*it + ".output")).first();
+ const ProString &tmp_out = project->first(ProKey(*it + ".output"));
if(tmp_out.isEmpty())
continue;
if (config.indexOf("combine") != -1) {
@@ -1690,7 +1690,7 @@ MakefileGenerator::verifyExtraCompiler(const ProString &comp, const QString &fil
}
}
} else if (config.indexOf("function_verify") != -1) {
- ProString tmp_out = project->values(ProKey(comp + ".output")).first();
+ ProString tmp_out = project->first(ProKey(comp + ".output"));
if(tmp_out.isEmpty())
return false;
ProStringList verify_function = project->values(ProKey(comp + ".verify_function"));
@@ -1735,7 +1735,7 @@ MakefileGenerator::verifyExtraCompiler(const ProString &comp, const QString &fil
}
}
} else if (config.indexOf("verify") != -1) {
- QString tmp_out = project->values(ProKey(comp + ".output")).first().toQString();
+ QString tmp_out = project->first(ProKey(comp + ".output")).toQString();
if(tmp_out.isEmpty())
return false;
const QString tmp_cmd = project->values(ProKey(comp + ".commands")).join(' ');
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index 8ca2b0a820..b3acbd8d0d 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -53,10 +53,6 @@ UnixMakefileGenerator::init()
}
}
- if (project->isEmpty("QMAKE_PREFIX_SHLIB"))
- // Prevent crash when using the empty variable.
- project->values("QMAKE_PREFIX_SHLIB").append("");
-
if(!project->isEmpty("QMAKE_FAILED_REQUIREMENTS")) /* no point */
return;
@@ -513,12 +509,12 @@ UnixMakefileGenerator::findLibraries()
if(!extn.isNull())
extens << extn;
else
- extens << project->values("QMAKE_EXTENSION_SHLIB").first() << "a";
+ extens << project->first("QMAKE_EXTENSION_SHLIB") << "a";
for (ProStringList::Iterator extit = extens.begin(); extit != extens.end(); ++extit) {
if(dir.isNull()) {
for(QList<QMakeLocalFileName>::Iterator dep_it = libdirs.begin(); dep_it != libdirs.end(); ++dep_it) {
QString pathToLib = ((*dep_it).local() + Option::dir_sep
- + project->values("QMAKE_PREFIX_SHLIB").first()
+ + project->first("QMAKE_PREFIX_SHLIB")
+ stub + "." + (*extit));
if(exists(pathToLib)) {
(*it) = "-l" + stub;
@@ -527,7 +523,7 @@ UnixMakefileGenerator::findLibraries()
}
}
} else {
- QString lib = dir + project->values("QMAKE_PREFIX_SHLIB").first() + stub + "." + (*extit);
+ QString lib = dir + project->first("QMAKE_PREFIX_SHLIB") + stub + "." + (*extit);
if (exists(lib)) {
(*it) = lib;
found = true;
@@ -537,8 +533,8 @@ UnixMakefileGenerator::findLibraries()
}
if(!found && project->isActiveConfig("compile_libtool")) {
for(int dep_i = 0; dep_i < libdirs.size(); ++dep_i) {
- if(exists(libdirs[dep_i].local() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + stub + Option::libtool_ext)) {
- (*it) = libdirs[dep_i].real() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + stub + Option::libtool_ext;
+ if (exists(libdirs[dep_i].local() + Option::dir_sep + project->first("QMAKE_PREFIX_SHLIB") + stub + Option::libtool_ext)) {
+ (*it) = libdirs[dep_i].real() + Option::dir_sep + project->first("QMAKE_PREFIX_SHLIB") + stub + Option::libtool_ext;
found = true;
break;
}
@@ -585,7 +581,7 @@ UnixMakefileGenerator::processPrlFiles()
for(int dep_i = 0; dep_i < libdirs.size(); ++dep_i) {
const QMakeLocalFileName &lfn = libdirs[dep_i];
if(!project->isActiveConfig("compile_libtool")) { //give them the .libs..
- QString la = lfn.local() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + lib + Option::libtool_ext;
+ QString la = lfn.local() + Option::dir_sep + project->first("QMAKE_PREFIX_SHLIB") + lib + Option::libtool_ext;
if(exists(la) && QFile::exists(lfn.local() + Option::dir_sep + ".libs")) {
QString dot_libs = lfn.real() + Option::dir_sep + ".libs";
l.append("-L" + dot_libs);
@@ -593,7 +589,7 @@ UnixMakefileGenerator::processPrlFiles()
}
}
- QString prl = lfn.local() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + lib + prl_ext;
+ QString prl = lfn.local() + Option::dir_sep + project->first("QMAKE_PREFIX_SHLIB") + lib + prl_ext;
if(processPrlFile(prl)) {
if(prl.startsWith(lfn.local()))
prl.replace(0, lfn.local().length(), lfn.real());
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index 149a58459d..f5be8717bf 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -75,14 +75,14 @@ UnixMakefileGenerator::writeMakefile(QTextStream &t)
if (writeDummyMakefile(t))
return true;
- if (project->values("TEMPLATE").first() == "app" ||
- project->values("TEMPLATE").first() == "lib" ||
- project->values("TEMPLATE").first() == "aux") {
+ if (project->first("TEMPLATE") == "app" ||
+ project->first("TEMPLATE") == "lib" ||
+ project->first("TEMPLATE") == "aux") {
if(Option::mkfile::do_stub_makefile && MakefileGenerator::writeStubMakefile(t))
return true;
writeMakeParts(t);
return MakefileGenerator::writeMakefile(t);
- } else if(project->values("TEMPLATE").first() == "subdirs") {
+ } else if (project->first("TEMPLATE") == "subdirs") {
MakefileGenerator::writeSubDirs(t);
return true;
}
@@ -456,7 +456,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
} else {
//actual target
QString incr_target_dir = var("DESTDIR") + "lib" + incr_target + "." +
- project->values("QMAKE_EXTENSION_SHLIB").first();
+ project->first("QMAKE_EXTENSION_SHLIB");
QString incr_lflags = var("QMAKE_LFLAGS_SHLIB") + " ";
if(project->isActiveConfig("debug"))
incr_lflags += var("QMAKE_LFLAGS_DEBUG");
@@ -1126,9 +1126,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
void UnixMakefileGenerator::init2()
{
if(project->isEmpty("QMAKE_FRAMEWORK_VERSION"))
- project->values("QMAKE_FRAMEWORK_VERSION").append(project->values("VER_MAJ").first());
+ project->values("QMAKE_FRAMEWORK_VERSION").append(project->first("VER_MAJ"));
- if (project->values("TEMPLATE").first() == "aux")
+ if (project->first("TEMPLATE") == "aux")
return;
if (!project->values("QMAKE_APP_FLAG").isEmpty()) {
@@ -1245,7 +1245,7 @@ void UnixMakefileGenerator::init2()
project->first("VER_MAJ") + "." +
project->first("VER_MIN") + "." +
project->first("VER_PAT") + "." +
- project->values("QMAKE_EXTENSION_SHLIB").first());
+ project->first("QMAKE_EXTENSION_SHLIB"));
} else {
project->values("TARGET_x").append("lib" + project->first("TARGET") + "." +
project->first("QMAKE_EXTENSION_SHLIB") +
@@ -1256,8 +1256,8 @@ void UnixMakefileGenerator::init2()
"." + project->first("VER_MIN"));
project->values("TARGET_x.y.z").append("lib" + project->first("TARGET") +
"." +
- project->values(
- "QMAKE_EXTENSION_SHLIB").first() + "." +
+ project->first(
+ "QMAKE_EXTENSION_SHLIB") + "." +
project->first("VER_MAJ") + "." +
project->first("VER_MIN") + "." +
project->first("VER_PAT"));
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index a0b5a7f35f..c89e66dde3 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -287,7 +287,7 @@ void Win32MakefileGenerator::processVars()
if (!project->isActiveConfig("skip_target_version_ext")
&& project->values("TARGET_VERSION_EXT").isEmpty()
&& !project->values("VER_MAJ").isEmpty())
- project->values("TARGET_VERSION_EXT").append(project->values("VER_MAJ").first());
+ project->values("TARGET_VERSION_EXT").append(project->first("VER_MAJ"));
if(project->isEmpty("QMAKE_COPY_FILE"))
project->values("QMAKE_COPY_FILE").append("$(COPY)");
@@ -406,7 +406,7 @@ void Win32MakefileGenerator::processRcFileVar()
else
productName = project->first("TARGET").toQString();
- QString originalName = project->values("TARGET").first() + project->values("TARGET_EXT").first();
+ QString originalName = project->first("TARGET") + project->first("TARGET_EXT");
int rcLang = project->intValue("RC_LANG", 1033); // default: English(USA)
int rcCodePage = project->intValue("RC_CODEPAGE", 1200); // default: Unicode
@@ -473,9 +473,9 @@ void Win32MakefileGenerator::processRcFileVar()
ts.flush();
- QString rcFilename = project->values("OUT_PWD").first()
+ QString rcFilename = project->first("OUT_PWD")
+ "/"
- + project->values("TARGET").first()
+ + project->first("TARGET")
+ "_resource"
+ ".rc";
QFile rcFile(QDir::cleanPath(rcFilename));
@@ -530,7 +530,7 @@ void Win32MakefileGenerator::processRcFileVar()
project->values("RES_FILE").first().prepend(resDestDir);
}
project->values("RES_FILE").first() = Option::fixPathToTargetOS(
- project->values("RES_FILE").first().toQString(), false, false);
+ project->first("RES_FILE").toQString(), false, false);
project->values("POST_TARGETDEPS") += project->values("RES_FILE");
project->values("CLEAN_FILES") += project->values("RES_FILE");
}