diff options
Diffstat (limited to 'src/libs/qmljs/qmljsmodelmanagerinterface.cpp')
-rw-r--r-- | src/libs/qmljs/qmljsmodelmanagerinterface.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp index 1f68926414..8075e6821e 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp @@ -875,7 +875,7 @@ static bool findNewQmlLibraryInPath(const Utils::FilePath &path, } // found a new library! - const std::optional<QByteArray> contents = qmldirFile.fileContents(); + const expected_str<QByteArray> contents = qmldirFile.fileContents(); if (!contents) return false; QString qmldirData = QString::fromUtf8(*contents); @@ -985,7 +985,7 @@ void ModelManagerInterface::parseLoop(QSet<Utils::FilePath> &scannedPaths, contents = entry.first; documentRevision = entry.second; } else { - const std::optional<QByteArray> fileContents = fileName.fileContents(); + const expected_str<QByteArray> fileContents = fileName.fileContents(); if (fileContents) { QTextStream ins(*fileContents); contents = ins.readAll(); @@ -1350,10 +1350,10 @@ void ModelManagerInterface::maybeQueueCppQmlTypeUpdate(const CPlusPlus::Document void ModelManagerInterface::queueCppQmlTypeUpdate(const CPlusPlus::Document::Ptr &doc, bool scan) { - QPair<CPlusPlus::Document::Ptr, bool> prev = m_queuedCppDocuments.value(doc->fileName()); + QPair<CPlusPlus::Document::Ptr, bool> prev = m_queuedCppDocuments.value(doc->filePath().path()); if (prev.first && prev.second) prev.first->releaseSourceAndAST(); - m_queuedCppDocuments.insert(doc->fileName(), {doc, scan}); + m_queuedCppDocuments.insert(doc->filePath().path(), {doc, scan}); m_updateCppQmlTypesTimer->start(); } @@ -1439,13 +1439,13 @@ void ModelManagerInterface::updateCppQmlTypes( CPlusPlus::Document::Ptr doc = pair.first; const bool scan = pair.second; - const QString fileName = doc->fileName(); + const FilePath filePath = doc->filePath(); if (!scan) { - hasNewInfo = newData.remove(fileName) || hasNewInfo; - const auto savedDocs = newDeclarations.value(fileName); + hasNewInfo = newData.remove(filePath.path()) || hasNewInfo; + const auto savedDocs = newDeclarations.value(filePath.path()); for (const CPlusPlus::Document::Ptr &savedDoc : savedDocs) { finder(savedDoc); - hasNewInfo = rescanExports(savedDoc->fileName(), finder, newData) || hasNewInfo; + hasNewInfo = rescanExports(savedDoc->filePath().path(), finder, newData) || hasNewInfo; } continue; } @@ -1453,7 +1453,7 @@ void ModelManagerInterface::updateCppQmlTypes( for (auto it = newDeclarations.begin(), end = newDeclarations.end(); it != end;) { for (auto docIt = it->begin(), endDocIt = it->end(); docIt != endDocIt;) { const CPlusPlus::Document::Ptr &savedDoc = *docIt; - if (savedDoc->fileName() == fileName) { + if (savedDoc->filePath() == filePath) { savedDoc->releaseSourceAndAST(); it->erase(docIt); break; @@ -1472,7 +1472,7 @@ void ModelManagerInterface::updateCppQmlTypes( doc->keepSourceAndAST(); // keep for later reparsing when dependent doc changes } - hasNewInfo = rescanExports(fileName, finder, newData) || hasNewInfo; + hasNewInfo = rescanExports(filePath.path(), finder, newData) || hasNewInfo; doc->releaseSourceAndAST(); } |