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

@@ -106,7 +106,7 @@ QmlProfilerDetailsRewriter::QmlProfilerDetailsRewriter(QObject *parent)
void QmlProfilerDetailsRewriter::requestDetailsForLocation(int typeId,
const QmlEventLocation &location)
{
const QString localFile = getLocalFile(location.filename());
const Utils::FilePath localFile = getLocalFile(location.filename());
if (localFile.isEmpty())
return;
@@ -116,16 +116,15 @@ void QmlProfilerDetailsRewriter::requestDetailsForLocation(int typeId,
m_pendingEvents.insert(localFile, {location, typeId});
}
QString QmlProfilerDetailsRewriter::getLocalFile(const QString &remoteFile)
Utils::FilePath QmlProfilerDetailsRewriter::getLocalFile(const QString &remoteFile)
{
const QString localFile = m_projectFinder.findFile(remoteFile).constFirst().toString();
const QFileInfo fileInfo(localFile);
if (!fileInfo.exists() || !fileInfo.isReadable())
return QString();
const Utils::FilePath localFile = m_projectFinder.findFile(remoteFile).constFirst();
if (!localFile.exists() || !localFile.isReadableFile())
return Utils::FilePath();
if (!QmlJS::ModelManagerInterface::guessLanguageOfFile(localFile).isQmlLikeOrJsLanguage())
return QString();
return Utils::FilePath();
return fileInfo.canonicalFilePath();
return localFile.canonicalPath();
}
void QmlProfilerDetailsRewriter::reloadDocuments()
@@ -182,7 +181,7 @@ void QmlProfilerDetailsRewriter::clear()
void QmlProfilerDetailsRewriter::documentReady(QmlJS::Document::Ptr doc)
{
const QString &fileName = doc->fileName();
const Utils::FilePath &fileName = doc->fileName();
auto first = m_pendingEvents.find(fileName);
// this could be triggered by an unrelated reload in Creator