diff --git a/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp b/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp index 0e66a71674b..34a52ddc82b 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp @@ -162,14 +162,14 @@ static void createTree(const QmakePriFile *pri, QmakePriFileNode *node) for (const FileName &file : newFilePaths) { auto vfs = pri->project()->qmakeVfs(); QString contents; + QString errorMessage; // Prefer the cumulative file if it's non-empty, based on the assumption // that it contains more "stuff". - vfs->readVirtualFile(file.toString(), QMakeVfs::VfsCumulative, &contents); + vfs->readFile(file.toString(), QMakeVfs::VfsCumulative, &contents, &errorMessage); // If the cumulative evaluation botched the file too much, try the exact one. if (contents.isEmpty()) - vfs->readVirtualFile(file.toString(), QMakeVfs::VfsExact, &contents); - auto resourceNode - = new ResourceEditor::ResourceTopLevelNode(file, false, contents, vfolder); + vfs->readFile(file.toString(), QMakeVfs::VfsExact, &contents, &errorMessage); + auto resourceNode = new ResourceEditor::ResourceTopLevelNode(file, false, contents, vfolder); vfolder->addNode(resourceNode); } } else { diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index b335fc2484c..abedb874033 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -358,14 +358,15 @@ void QmakeProject::updateQmlJSCodeModel() projectInfo.activeResourceFiles.append(exactResources); projectInfo.allResourceFiles.append(exactResources); projectInfo.allResourceFiles.append(cumulativeResources); + QString errorMessage; foreach (const QString &rc, exactResources) { QString contents; - if (m_qmakeVfs->readVirtualFile(rc, QMakeVfs::VfsExact, &contents)) + if (m_qmakeVfs->readFile(rc, QMakeVfs::VfsExact, &contents, &errorMessage) == QMakeVfs::ReadOk) projectInfo.resourceFileContents[rc] = contents; } foreach (const QString &rc, cumulativeResources) { QString contents; - if (m_qmakeVfs->readVirtualFile(rc, QMakeVfs::VfsCumulative, &contents)) + if (m_qmakeVfs->readFile(rc, QMakeVfs::VfsCumulative, &contents, &errorMessage) == QMakeVfs::ReadOk) projectInfo.resourceFileContents[rc] = contents; } if (!hasQmlLib) {