forked from qt-creator/qt-creator
Utils: Rename FilePath::absolutePath(FilePath) to resolvePath
There was already a similar function taking a QString. After that, the remaining no-argument version of absolutePath() can be deprecated. Change-Id: I5b9ad8c8b68a5723891b0aa9f5a37e90db0fe09e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -381,12 +381,19 @@ bool FilePath::isRelativePath() const
|
||||
return isRelativePathHelper(m_data, osType());
|
||||
}
|
||||
|
||||
FilePath FilePath::resolvePath(const QString &fileName) const
|
||||
FilePath FilePath::resolvePath(const FilePath &tail) const
|
||||
{
|
||||
if (FileUtils::isAbsolutePath(fileName))
|
||||
return FilePath::fromString(QDir::cleanPath(fileName));
|
||||
if (!isRelativePathHelper(tail.m_data, osType()))
|
||||
return tail;
|
||||
return pathAppended(tail.m_data);
|
||||
}
|
||||
|
||||
FilePath FilePath::resolvePath(const QString &tail) const
|
||||
{
|
||||
if (!FileUtils::isRelativePath(tail))
|
||||
return FilePath::fromString(QDir::cleanPath(tail));
|
||||
FilePath result = *this;
|
||||
result.setPath(QDir::cleanPath(m_data + '/' + fileName));
|
||||
result.setPath(QDir::cleanPath(m_data + '/' + tail));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -846,13 +853,6 @@ FilePath FilePath::absoluteFilePath() const
|
||||
return result;
|
||||
}
|
||||
|
||||
FilePath FilePath::absoluteFilePath(const FilePath &tail) const
|
||||
{
|
||||
if (isRelativePathHelper(tail.m_data, osType()))
|
||||
return pathAppended(tail.m_data);
|
||||
return tail;
|
||||
}
|
||||
|
||||
FilePath FilePath::normalizedPathName() const
|
||||
{
|
||||
FilePath result = *this;
|
||||
|
||||
Reference in New Issue
Block a user