summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Kudryavtsev <[email protected]>2023-09-07 17:51:29 +0300
committerAnton Kudryavtsev <[email protected]>2023-09-08 19:17:36 +0300
commit9c819c90736af798c7ede157c8f96c6c2070ddd5 (patch)
tree78ab1ec24f60f68b907e5d18cb9638dfbbb4e719
parentd232acbce01ea73d99f8435e554769059de9613e (diff)
tools: use const methods more
to avoid implicit detach Change-Id: I6268d4397631a2a2ff54263dfd0b28a7990c5993 Reviewed-by: Volker Hilsheimer <[email protected]>
-rw-r--r--src/tools/androiddeployqt/main.cpp2
-rw-r--r--src/tools/macdeployqt/shared/shared.cpp4
-rw-r--r--src/tools/qtpaths/qtpaths.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp
index b969183cdd3..cba1dc61fed 100644
--- a/src/tools/androiddeployqt/main.cpp
+++ b/src/tools/androiddeployqt/main.cpp
@@ -808,7 +808,7 @@ QString detectLatestAndroidPlatform(const QString &sdkPath)
std::sort(fileInfos.begin(), fileInfos.end(), quasiLexicographicalReverseLessThan);
- QFileInfo latestPlatform = fileInfos.first();
+ const QFileInfo& latestPlatform = fileInfos.constFirst();
return latestPlatform.baseName();
}
diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp
index c1dbd3dcf8e..0671ebf2f32 100644
--- a/src/tools/macdeployqt/shared/shared.cpp
+++ b/src/tools/macdeployqt/shared/shared.cpp
@@ -172,7 +172,7 @@ OtoolInfo findDependencyInfo(const QString &binaryPath)
outputLines.removeFirst(); // remove line containing the binary path
if (binaryPath.contains(".framework/") || binaryPath.endsWith(".dylib")) {
- const auto match = regexp.match(outputLines.first());
+ const auto match = regexp.match(outputLines.constFirst());
if (match.hasMatch()) {
QString installname = match.captured(1);
if (QFileInfo(binaryPath).fileName() == QFileInfo(installname).fileName()) {
@@ -184,7 +184,7 @@ OtoolInfo findDependencyInfo(const QString &binaryPath)
info.installName = binaryPath;
}
} else {
- LogDebug() << "Could not parse otool output line:" << outputLines.first();
+ LogDebug() << "Could not parse otool output line:" << outputLines.constFirst();
outputLines.removeFirst();
}
}
diff --git a/src/tools/qtpaths/qtpaths.cpp b/src/tools/qtpaths/qtpaths.cpp
index a840f08ba60..76d8a11913e 100644
--- a/src/tools/qtpaths/qtpaths.cpp
+++ b/src/tools/qtpaths/qtpaths.cpp
@@ -347,7 +347,7 @@ int main(int argc, char **argv)
if (results.isEmpty()) {
parser.showHelp();
} else if (results.size() == 1) {
- const QString &item = results.first();
+ const QString &item = results.constFirst();
message(item);
if (item.isEmpty())
return EXIT_FAILURE;