qmljs: (QString -> Utils::FilePath)++

convert more QString containing paths to Utils::FilePath

Change-Id: I1219d7d147993e48cfa641dc9bea72ab38c90f51
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Fawzi Mohamed
2022-06-20 12:35:13 +02:00
committed by Tim Jenssen
parent 0bb272d411
commit fd89043de2
79 changed files with 844 additions and 680 deletions

View File

@@ -234,9 +234,15 @@ void QmlBuildSystem::parseProject(RefreshOptions options)
if (m_projectItem->targetDirectory().isEmpty())
m_projectItem->setTargetDirectory(canonicalProjectDir().toString());
if (auto modelManager = QmlJS::ModelManagerInterface::instance())
modelManager->updateSourceFiles(m_projectItem->files(), true);
if (auto modelManager = QmlJS::ModelManagerInterface::instance()) {
QStringList files = m_projectItem->files();
Utils::FilePaths filePaths(files.size());
std::transform(files.cbegin(),
files.cend(),
filePaths.begin(),
[](const QString &p) { return Utils::FilePath::fromString(p); });
modelManager->updateSourceFiles(filePaths, true);
}
QString mainFilePath = m_projectItem->mainFile();
if (!mainFilePath.isEmpty()) {
mainFilePath
@@ -522,8 +528,14 @@ void QmlBuildSystem::refreshFiles(const QSet<QString> &/*added*/, const QSet<QSt
}
refresh(Files);
if (!removed.isEmpty()) {
if (auto modelManager = QmlJS::ModelManagerInterface::instance())
modelManager->removeFiles(Utils::toList(removed));
if (auto modelManager = QmlJS::ModelManagerInterface::instance()) {
Utils::FilePaths pathsRemoved(removed.size());
std::transform(removed.cbegin(),
removed.cend(),
pathsRemoved.begin(),
[](const QString &s) { return Utils::FilePath::fromString(s); });
modelManager->removeFiles(pathsRemoved);
}
}
refreshTargetDirectory();
}