tools: use const methods more
to avoid implicit detach Change-Id: I6268d4397631a2a2ff54263dfd0b28a7990c5993 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
d232acbce0
commit
9c819c9073
@ -808,7 +808,7 @@ QString detectLatestAndroidPlatform(const QString &sdkPath)
|
|||||||
|
|
||||||
std::sort(fileInfos.begin(), fileInfos.end(), quasiLexicographicalReverseLessThan);
|
std::sort(fileInfos.begin(), fileInfos.end(), quasiLexicographicalReverseLessThan);
|
||||||
|
|
||||||
QFileInfo latestPlatform = fileInfos.first();
|
const QFileInfo& latestPlatform = fileInfos.constFirst();
|
||||||
return latestPlatform.baseName();
|
return latestPlatform.baseName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ OtoolInfo findDependencyInfo(const QString &binaryPath)
|
|||||||
|
|
||||||
outputLines.removeFirst(); // remove line containing the binary path
|
outputLines.removeFirst(); // remove line containing the binary path
|
||||||
if (binaryPath.contains(".framework/") || binaryPath.endsWith(".dylib")) {
|
if (binaryPath.contains(".framework/") || binaryPath.endsWith(".dylib")) {
|
||||||
const auto match = regexp.match(outputLines.first());
|
const auto match = regexp.match(outputLines.constFirst());
|
||||||
if (match.hasMatch()) {
|
if (match.hasMatch()) {
|
||||||
QString installname = match.captured(1);
|
QString installname = match.captured(1);
|
||||||
if (QFileInfo(binaryPath).fileName() == QFileInfo(installname).fileName()) {
|
if (QFileInfo(binaryPath).fileName() == QFileInfo(installname).fileName()) {
|
||||||
@ -184,7 +184,7 @@ OtoolInfo findDependencyInfo(const QString &binaryPath)
|
|||||||
info.installName = binaryPath;
|
info.installName = binaryPath;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LogDebug() << "Could not parse otool output line:" << outputLines.first();
|
LogDebug() << "Could not parse otool output line:" << outputLines.constFirst();
|
||||||
outputLines.removeFirst();
|
outputLines.removeFirst();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -347,7 +347,7 @@ int main(int argc, char **argv)
|
|||||||
if (results.isEmpty()) {
|
if (results.isEmpty()) {
|
||||||
parser.showHelp();
|
parser.showHelp();
|
||||||
} else if (results.size() == 1) {
|
} else if (results.size() == 1) {
|
||||||
const QString &item = results.first();
|
const QString &item = results.constFirst();
|
||||||
message(item);
|
message(item);
|
||||||
if (item.isEmpty())
|
if (item.isEmpty())
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user