diff options
author | Sami Shalayel <[email protected]> | 2025-09-16 17:45:37 +0200 |
---|---|---|
committer | Sami Shalayel <[email protected]> | 2025-09-18 15:42:20 +0200 |
commit | 5e0ad461fe79bae7052a51e224d433a2b8b68416 (patch) | |
tree | 6cb2463627bab68f1f977cd52481319189e8fc3e | |
parent | 52e6456d6e71c3e93f7de7b3369738dc0d802b33 (diff) |
qmlls: don't search C++ headers on fallback codemodel
Don't search C++ headers on fallback code model: the url is empty so it
seems we end up searching the current working directory(?) of qmlls for
C++ headers. This might have caused some flakyness in
tst_qmlls_qqmlcodemodel where some unrelated tests timeout because of
this useless search.
Change-Id: I0a5c9071cdd5a2f06f5ef8b392b2091b357e4887
Reviewed-by: Ulf Hermann <[email protected]>
-rw-r--r-- | src/qmlls/qqmlcodemodel.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qmlls/qqmlcodemodel.cpp b/src/qmlls/qqmlcodemodel.cpp index 7a68766ec1..a069e25c7a 100644 --- a/src/qmlls/qqmlcodemodel.cpp +++ b/src/qmlls/qqmlcodemodel.cpp @@ -351,6 +351,7 @@ This is an overapproximation and might find unrelated files with the same name. QStringList QQmlCodeModel::findFilePathsFromFileNames(const QStringList &_fileNamesToSearch, const QSet<QString> &ignoredFilePaths) { + Q_ASSERT(!m_rootUrl.isEmpty()); QStringList fileNamesToSearch{ _fileNamesToSearch }; { @@ -419,10 +420,12 @@ QStringList QQmlCodeModel::fileNamesToWatch(const DomItem &qmlFile) /*! \internal Add watches for all C++ files that this qmlFile relies on, so a rebuild can be triggered when they -are modified. +are modified. Is a no op if this is the fallback codemodel with empty root url. */ void QQmlCodeModel::addFileWatches(const DomItem &qmlFile) { + if (m_rootUrl.isEmpty()) + return; const auto filesToWatch = fileNamesToWatch(qmlFile); // remove already watched files to avoid a warning later on |