summaryrefslogtreecommitdiffstats
path: root/qmake/generators/mac
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-08-20 14:33:08 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-28 20:48:13 +0200
commit3db9344f04642108ffc7bb9dcc688d2ce7dbb9d3 (patch)
tree142137533868557a06e883cf404606941420c913 /qmake/generators/mac
parent996bbcd78ba50d71fa3da4727e5cb87ed9efe15a (diff)
beautify string operations
Change-Id: I895a1ae26ee0c884c404bf585261d1a7e8a8242c Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Diffstat (limited to 'qmake/generators/mac')
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index b19ea32a2f..27bc1e48fb 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -792,8 +792,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
for(int x = 0; x < tmp.count();) {
bool remove = false;
QString library, name, opt = tmp[x].trimmed();
- if(opt.length() >= 2 && (opt[0] == '"' || opt[0] == '\'') &&
- opt[(int) opt.length()-1] == opt[0])
+ if (opt.length() >= 2 && (opt.at(0) == '"' || opt.at(0) == '\'') && opt.endsWith(opt.at(0)))
opt = opt.mid(1, opt.length()-2);
if(opt.startsWith("-L")) {
QString r = opt.right(opt.length() - 2);
@@ -867,7 +866,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
break;
}
}
- } else if(opt.left(1) != "-") {
+ } else if (!opt.startsWith('-')) {
if(exists(opt)) {
remove = true;
library = opt;
@@ -981,7 +980,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << "files = (" << "\n";
if(!project->isEmpty("ICON")) {
QString icon = project->first("ICON");
- if(icon.length() >= 2 && (icon[0] == '"' || icon[0] == '\'') && icon[(int)icon.length()-1] == icon[0])
+ if (icon.length() >= 2 && (icon.at(0) == '"' || icon.at(0) == '\'') && icon.endsWith(icon.at(0)))
icon = icon.mid(1, icon.length()-2);
t << "\t\t\t\t" << keyFor(icon + ".BUILDABLE") << ",\n";
}