Fix warnings about possible detach of temporary objects

Calling first() or last() on temporary container may
unnecessarily detach the container. Fix it by calling
constFirst() and constLast().

Change-Id: I2460efd5dbee1534eec8a514d9bff2a947bfddf9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Jarek Kobus
2020-11-16 21:58:53 +01:00
parent 27c962f503
commit eaba657d90
11 changed files with 12 additions and 11 deletions

View File

@@ -327,7 +327,8 @@ void AndroidSettingsWidget::updateNdkList()
void AndroidSettingsWidget::addCustomNdkItem()
{
const QString homePath = QStandardPaths::standardLocations(QStandardPaths::HomeLocation).first();
const QString homePath = QStandardPaths::standardLocations(QStandardPaths::HomeLocation)
.constFirst();
const QString ndkPath = QFileDialog::getExistingDirectory(this, tr("Select an NDK"), homePath);
if (m_androidConfig.isValidNdk(ndkPath)) {