Utils: Rename FileName to FilePath

More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-05-28 13:49:26 +02:00
parent 4704f49fbb
commit 473a741c9f
688 changed files with 3487 additions and 3484 deletions

View File

@@ -121,7 +121,7 @@ private:
// QbsProject:
// --------------------------------------------------------------------
QbsProject::QbsProject(const FileName &fileName) :
QbsProject::QbsProject(const FilePath &fileName) :
Project(Constants::MIME_TYPE, fileName, [this] { delayParsing(); }),
m_cppCodeModelUpdater(new CppTools::CppProjectUpdater)
{
@@ -484,16 +484,16 @@ void QbsProject::updateProjectNodes()
rebuildProjectTree();
}
FileName QbsProject::installRoot()
FilePath QbsProject::installRoot()
{
if (!activeTarget())
return FileName();
return FilePath();
const auto * const bc
= qobject_cast<QbsBuildConfiguration *>(activeTarget()->activeBuildConfiguration());
if (!bc)
return FileName();
return FilePath();
const QbsBuildStep * const buildStep = bc->qbsStep();
return buildStep && buildStep->install() ? buildStep->installRoot() : FileName();
return buildStep && buildStep->install() ? buildStep->installRoot() : FilePath();
}
void QbsProject::handleQbsParsingDone(bool success)
@@ -681,7 +681,7 @@ void QbsProject::generateErrors(const qbs::ErrorInfo &e)
foreach (const qbs::ErrorItem &item, e.items())
TaskHub::addTask(Task::Error, item.description(),
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM,
FileName::fromString(item.codeLocation().filePath()),
FilePath::fromString(item.codeLocation().filePath()),
item.codeLocation().line());
}
@@ -763,11 +763,11 @@ void QbsProject::updateDocuments(const QSet<QString> &files)
}
}
QSet<IDocument *> toAdd;
const FileName buildDir = FileName::fromString(m_projectData.buildDirectory());
const FilePath buildDir = FilePath::fromString(m_projectData.buildDirectory());
for (const QString &f : qAsConst(filesToAdd)) {
// A changed qbs file (project, module etc) should trigger a re-parse, but not if
// the file was generated by qbs itself, in which case that might cause an infinite loop.
const FileName fp = FileName::fromString(f);
const FilePath fp = FilePath::fromString(f);
static const ProjectDocument::ProjectCallback noOpCallback = []{};
const ProjectDocument::ProjectCallback reparseCallback = [this]() { delayParsing(); };
toAdd.insert(new ProjectDocument(Constants::MIME_TYPE, fp, fp.isChildOf(buildDir)
@@ -971,7 +971,7 @@ void QbsProject::updateCppCodeModel()
list.removeDuplicates();
ProjectExplorer::HeaderPaths grpHeaderPaths;
foreach (const QString &p, list)
grpHeaderPaths += {FileName::fromUserInput(p).toString(), HeaderPathType::User};
grpHeaderPaths += {FilePath::fromUserInput(p).toString(), HeaderPathType::User};
list = props.getModulePropertiesAsStringList(QLatin1String(CONFIG_CPP_MODULE),
QLatin1String(CONFIG_FRAMEWORKPATHS));
@@ -979,7 +979,7 @@ void QbsProject::updateCppCodeModel()
QLatin1String(CONFIG_SYSTEM_FRAMEWORKPATHS)));
list.removeDuplicates();
foreach (const QString &p, list)
grpHeaderPaths += {FileName::fromUserInput(p).toString(), HeaderPathType::Framework};
grpHeaderPaths += {FilePath::fromUserInput(p).toString(), HeaderPathType::Framework};
rpp.setHeaderPaths(grpHeaderPaths);
@@ -1018,12 +1018,12 @@ void QbsProject::updateCppCodeModel()
continue;
}
const FileNameList fileNames = Utils::transform(generated,
const FilePathList fileNames = Utils::transform(generated,
[](const QString &s) {
return Utils::FileName::fromString(s);
return Utils::FilePath::fromString(s);
});
m_extraCompilers.append((*i)->create(
this, FileName::fromString(source.filePath()), fileNames));
this, FilePath::fromString(source.filePath()), fileNames));
}
}
}
@@ -1079,7 +1079,7 @@ void QbsProject::updateQmlJsCodeModel()
foreach (const qbs::ProductData &product, m_projectData.allProducts()) {
static const QString propertyName = QLatin1String("qmlImportPaths");
foreach (const QString &path, product.properties().value(propertyName).toStringList()) {
projectInfo.importPaths.maybeInsert(Utils::FileName::fromString(path),
projectInfo.importPaths.maybeInsert(Utils::FilePath::fromString(path),
QmlJS::Dialect::Qml);
}
}
@@ -1109,8 +1109,8 @@ void QbsProject::updateApplicationTargets()
BuildTargetInfo bti;
bti.buildKey = QbsProject::uniqueProductName(productData);
bti.targetFilePath = FileName::fromString(targetFile);
bti.projectFilePath = FileName::fromString(projectFile);
bti.targetFilePath = FilePath::fromString(targetFile);
bti.projectFilePath = FilePath::fromString(projectFile);
bti.isQtcRunnable = isQtcRunnable; // Fixed up below.
bti.usesTerminal = usesTerminal;
bti.displayName = productData.fullDisplayName();