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:
@@ -398,13 +398,13 @@ bool FileUtils::isRelativePath(const QString &path)
|
||||
return true;
|
||||
}
|
||||
|
||||
QString FileUtils::resolvePath(const QString &baseDir, const QString &fileName)
|
||||
FilePath FilePath::resolvePath(const QString &fileName) const
|
||||
{
|
||||
if (fileName.isEmpty())
|
||||
return QString();
|
||||
if (isAbsolutePath(fileName))
|
||||
return QDir::cleanPath(fileName);
|
||||
return QDir::cleanPath(baseDir + QLatin1Char('/') + fileName);
|
||||
return {}; // FIXME: Isn't this odd?
|
||||
if (FileUtils::isAbsolutePath(fileName))
|
||||
return FilePath::fromString(QDir::cleanPath(fileName));
|
||||
return FilePath::fromString(QDir::cleanPath(toString() + QLatin1Char('/') + fileName));
|
||||
}
|
||||
|
||||
FilePath FileUtils::commonPath(const FilePath &oldCommonPath, const FilePath &filePath)
|
||||
|
||||
Reference in New Issue
Block a user