forked from qt-creator/qt-creator
Fix warning: "Don't call QVector::first() on temporary QList/QVector"
[-Wclazy-detaching-temporary] Change-Id: I23f5cbd80bb92d3f9f1bfb5ae07493818958c5b0 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -253,7 +253,7 @@ ModelManagerInterface::WorkingCopy ModelManager::workingCopyInternal() const
|
||||
const QString key = document->filePath().toString();
|
||||
if (auto textDocument = qobject_cast<const TextEditor::TextDocument *>(document)) {
|
||||
// TODO the language should be a property on the document, not the editor
|
||||
if (DocumentModel::editorsForDocument(document).first()
|
||||
if (DocumentModel::editorsForDocument(document).constFirst()
|
||||
->context().contains(ProjectExplorer::Constants::QMLJS_LANGUAGE_ID)) {
|
||||
workingCopy.insert(key, textDocument->plainText(),
|
||||
textDocument->document()->revision());
|
||||
|
||||
Reference in New Issue
Block a user