Utils: Introduce a FilePath::absolutePath() function

... and start using it.

Change-Id: I44c74005a4deee72d0332106a4ce3582e0b66191
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2019-12-18 18:55:27 +01:00
parent 84d0e3dda8
commit 711daa3803
3 changed files with 11 additions and 5 deletions

View File

@@ -800,6 +800,13 @@ FilePath FilePath::parentDir() const
return FilePath::fromString(parent);
}
FilePath FilePath::absolutePath() const
{
FilePath result = *this;
result.m_data = QFileInfo(m_data).absolutePath();
return result;
}
/// Constructs a FilePath from \a filename
/// \a filename is not checked for validity.
FilePath FilePath::fromString(const QString &filename)