forked from qt-creator/qt-creator
Utils: Move FileUtils::resolvePath to FilePath
In line with the general move toward use of FilePath nowadays. Change-Id: I1c50e1479f7d9100ff8ded3ce3c22dd82b7fe6aa Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -66,9 +66,9 @@ static FilePath defaultBuildDirectory(const FilePath &projectFilePath, const Kit
|
||||
{
|
||||
const QString projectName = projectFilePath.toFileInfo().completeBaseName();
|
||||
ProjectMacroExpander expander(projectFilePath, projectName, k, bcName, buildType);
|
||||
QString projectDir = Project::projectDirectory(projectFilePath).toString();
|
||||
FilePath projectDir = Project::projectDirectory(projectFilePath);
|
||||
QString buildPath = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate());
|
||||
return FilePath::fromString(FileUtils::resolvePath(projectDir, buildPath));
|
||||
return projectDir.resolvePath(buildPath);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -86,14 +86,14 @@ QbsProjectImporter::QbsProjectImporter(const FilePath &path) : QtProjectImporter
|
||||
{
|
||||
}
|
||||
|
||||
static QString buildDir(const FilePath &projectFilePath, const Kit *k)
|
||||
static FilePath buildDir(const FilePath &projectFilePath, const Kit *k)
|
||||
{
|
||||
const QString projectName = projectFilePath.toFileInfo().completeBaseName();
|
||||
ProjectMacroExpander expander(projectFilePath, projectName, k, QString(),
|
||||
BuildConfiguration::Unknown);
|
||||
const QString projectDir = Project::projectDirectory(projectFilePath).toString();
|
||||
const FilePath projectDir = Project::projectDirectory(projectFilePath);
|
||||
const QString buildPath = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate());
|
||||
return FileUtils::resolvePath(projectDir, buildPath);
|
||||
return projectDir.resolvePath(buildPath);
|
||||
}
|
||||
|
||||
static bool hasBuildGraph(const QString &dir)
|
||||
@@ -123,7 +123,7 @@ QStringList QbsProjectImporter::importCandidates()
|
||||
seenCandidates.insert(projectDir);
|
||||
const auto &kits = KitManager::kits();
|
||||
for (Kit * const k : kits) {
|
||||
QFileInfo fi(buildDir(projectFilePath(), k));
|
||||
QFileInfo fi = buildDir(projectFilePath(), k).toFileInfo();
|
||||
const QString candidate = fi.absolutePath();
|
||||
if (!seenCandidates.contains(candidate)) {
|
||||
seenCandidates.insert(candidate);
|
||||
|
||||
Reference in New Issue
Block a user