forked from qt-creator/qt-creator
QmlJS: Move ensuredGetDocumentForPath to ModelManagerInterface
The new function does properly update the latest snapshot. Change-Id: If3148701e2f98c39a0822d1395b43f4fa7ee1949 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
committed by
Fawzi Mohamed
parent
bafe7dbb0b
commit
2aa7df6dff
@@ -1379,6 +1379,19 @@ void ModelManagerInterface::joinAllThreads()
|
||||
future.waitForFinished();
|
||||
}
|
||||
|
||||
Document::Ptr ModelManagerInterface::ensuredGetDocumentForPath(const QString &filePath)
|
||||
{
|
||||
QmlJS::Document::Ptr document = newestSnapshot().document(filePath);
|
||||
if (!document) {
|
||||
document = QmlJS::Document::create(filePath, QmlJS::Language::Qml);
|
||||
QMutexLocker lock(&m_mutex);
|
||||
|
||||
m_newestSnapshot.insert(document);
|
||||
}
|
||||
|
||||
return document;
|
||||
}
|
||||
|
||||
void ModelManagerInterface::resetCodeModel()
|
||||
{
|
||||
QStringList documents;
|
||||
|
||||
Reference in New Issue
Block a user