forked from qt-creator/qt-creator
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:
@@ -88,7 +88,7 @@ QUrl QmlPreviewConnectionManager::findValidI18nDirectoryAsUrl(const QString &loc
|
||||
auto tryPath = [&](const QString &postfix) {
|
||||
url.setPath(path + "/i18n/qml_" + postfix);
|
||||
bool success = false;
|
||||
foundPath = m_projectFileFinder.findFile(url, &success).first().toString();
|
||||
foundPath = m_projectFileFinder.findFile(url, &success).constFirst().toString();
|
||||
foundPath = foundPath.left(qMax(0, foundPath.lastIndexOf("/i18n")));
|
||||
return success;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user