forked from qt-creator/qt-creator
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:
@@ -80,7 +80,7 @@ static CMakeBuildConfiguration *activeBc(const CMakeProject *p)
|
||||
/*!
|
||||
\class CMakeProject
|
||||
*/
|
||||
CMakeProject::CMakeProject(const FileName &fileName) : Project(Constants::CMAKEMIMETYPE, fileName),
|
||||
CMakeProject::CMakeProject(const FilePath &fileName) : Project(Constants::CMAKEMIMETYPE, fileName),
|
||||
m_cppCodeModelUpdater(new CppTools::CppProjectUpdater)
|
||||
{
|
||||
setId(CMakeProjectManager::Constants::CMAKEPROJECT_ID);
|
||||
@@ -213,7 +213,7 @@ CMakeProject::CMakeProject(const FileName &fileName) : Project(Constants::CMAKEM
|
||||
// TreeScanner:
|
||||
connect(&m_treeScanner, &TreeScanner::finished, this, &CMakeProject::handleTreeScanningFinished);
|
||||
|
||||
m_treeScanner.setFilter([this](const Utils::MimeType &mimeType, const Utils::FileName &fn) {
|
||||
m_treeScanner.setFilter([this](const Utils::MimeType &mimeType, const Utils::FilePath &fn) {
|
||||
// Mime checks requires more resources, so keep it last in check list
|
||||
auto isIgnored =
|
||||
fn.toString().startsWith(projectFilePath().toString() + ".user") ||
|
||||
@@ -233,7 +233,7 @@ CMakeProject::CMakeProject(const FileName &fileName) : Project(Constants::CMAKEM
|
||||
return isIgnored;
|
||||
});
|
||||
|
||||
m_treeScanner.setTypeFactory([](const Utils::MimeType &mimeType, const Utils::FileName &fn) {
|
||||
m_treeScanner.setTypeFactory([](const Utils::MimeType &mimeType, const Utils::FilePath &fn) {
|
||||
auto type = TreeScanner::genericFileType(mimeType, fn);
|
||||
if (type == FileType::Unknown) {
|
||||
if (mimeType.isValid()) {
|
||||
@@ -381,7 +381,7 @@ void CMakeProject::updateQmlJSCodeModel()
|
||||
}
|
||||
|
||||
foreach (const QString &cmakeImport, CMakeConfigItem::cmakeSplitValue(cmakeImports))
|
||||
projectInfo.importPaths.maybeInsert(FileName::fromString(cmakeImport), QmlJS::Dialect::Qml);
|
||||
projectInfo.importPaths.maybeInsert(FilePath::fromString(cmakeImport), QmlJS::Dialect::Qml);
|
||||
|
||||
modelManager->updateProjectInfo(projectInfo, this);
|
||||
}
|
||||
@@ -588,16 +588,16 @@ QStringList CMakeProject::filesGeneratedFrom(const QString &sourceFile) const
|
||||
if (!activeTarget())
|
||||
return QStringList();
|
||||
QFileInfo fi(sourceFile);
|
||||
FileName project = projectDirectory();
|
||||
FileName baseDirectory = FileName::fromString(fi.absolutePath());
|
||||
FilePath project = projectDirectory();
|
||||
FilePath baseDirectory = FilePath::fromString(fi.absolutePath());
|
||||
|
||||
while (baseDirectory.isChildOf(project)) {
|
||||
const FileName cmakeListsTxt = baseDirectory.pathAppended("CMakeLists.txt");
|
||||
const FilePath cmakeListsTxt = baseDirectory.pathAppended("CMakeLists.txt");
|
||||
if (cmakeListsTxt.exists())
|
||||
break;
|
||||
QDir dir(baseDirectory.toString());
|
||||
dir.cdUp();
|
||||
baseDirectory = FileName::fromString(dir.absolutePath());
|
||||
baseDirectory = FilePath::fromString(dir.absolutePath());
|
||||
}
|
||||
|
||||
QDir srcDirRoot = QDir(project.toString());
|
||||
@@ -623,7 +623,7 @@ QStringList CMakeProject::filesGeneratedFrom(const QString &sourceFile) const
|
||||
|
||||
ProjectExplorer::DeploymentKnowledge CMakeProject::deploymentKnowledge() const
|
||||
{
|
||||
return contains(files(AllFiles), [](const FileName &f) {
|
||||
return contains(files(AllFiles), [](const FilePath &f) {
|
||||
return f.fileName() == "QtCreatorDeployment.txt";
|
||||
}) ? DeploymentKnowledge::Approximative : DeploymentKnowledge::Bad;
|
||||
}
|
||||
@@ -658,7 +658,7 @@ QList<ProjectExplorer::ExtraCompiler *> CMakeProject::findExtraCompilers() const
|
||||
= Utils::transform<QSet>(factories, &ExtraCompilerFactory::sourceTag);
|
||||
|
||||
// Find all files generated by any of the extra compilers, in a rather crude way.
|
||||
const FileNameList fileList = files([&fileExtensions](const Node *n) {
|
||||
const FilePathList fileList = files([&fileExtensions](const Node *n) {
|
||||
if (!SourceFiles(n))
|
||||
return false;
|
||||
const QString fp = n->filePath().toString();
|
||||
@@ -667,7 +667,7 @@ QList<ProjectExplorer::ExtraCompiler *> CMakeProject::findExtraCompilers() const
|
||||
});
|
||||
|
||||
// Generate the necessary information:
|
||||
for (const FileName &file : fileList) {
|
||||
for (const FilePath &file : fileList) {
|
||||
ExtraCompilerFactory *factory = Utils::findOrDefault(factories, [&file](const ExtraCompilerFactory *f) {
|
||||
return file.endsWith('.' + f->sourceTag());
|
||||
});
|
||||
@@ -677,9 +677,9 @@ QList<ProjectExplorer::ExtraCompiler *> CMakeProject::findExtraCompilers() const
|
||||
if (generated.isEmpty())
|
||||
continue;
|
||||
|
||||
const FileNameList fileNames
|
||||
const FilePathList fileNames
|
||||
= transform(generated,
|
||||
[](const QString &s) { return FileName::fromString(s); });
|
||||
[](const QString &s) { return FilePath::fromString(s); });
|
||||
extraCompilers.append(factory->create(this, file, fileNames));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user