forked from qt-creator/qt-creator
Don't call non-const method on temporary container
...as it may detach. Fix the following clazy warning: Don't call QList::first() on temporary [clazy-detaching-temporary]. Change-Id: I667c122c42ccfc1344508154466d9c1dc6ae6166 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -548,7 +548,7 @@ void PerfProfilerTool::gotoSourceLocation(QString filePath, int lineNumber, int
|
||||
|
||||
QFileInfo fi(filePath);
|
||||
if (!fi.isAbsolute() || !fi.exists() || !fi.isReadable()) {
|
||||
fi.setFile(m_fileFinder.findFile(filePath).first().toString());
|
||||
fi.setFile(m_fileFinder.findFile(filePath).constFirst().toString());
|
||||
if (!fi.exists() || !fi.isReadable())
|
||||
return;
|
||||
}
|
||||
|
@@ -329,7 +329,7 @@ void TransitionEditorWidget::init()
|
||||
if (root.isValid() && root.hasProperty("transitions")) {
|
||||
NodeAbstractProperty transitions = root.nodeAbstractProperty("transitions");
|
||||
if (transitions.isValid())
|
||||
transition = transitions.directSubNodes().first();
|
||||
transition = transitions.directSubNodes().constFirst();
|
||||
}
|
||||
|
||||
m_graphicsScene->setTransition(transition);
|
||||
|
@@ -118,7 +118,7 @@ void QmlProfilerDetailsRewriter::requestDetailsForLocation(int typeId,
|
||||
|
||||
QString QmlProfilerDetailsRewriter::getLocalFile(const QString &remoteFile)
|
||||
{
|
||||
const QString localFile = m_projectFinder.findFile(remoteFile).first().toString();
|
||||
const QString localFile = m_projectFinder.findFile(remoteFile).constFirst().toString();
|
||||
const QFileInfo fileInfo(localFile);
|
||||
if (!fileInfo.exists() || !fileInfo.isReadable())
|
||||
return QString();
|
||||
|
Reference in New Issue
Block a user