FilePath: only assert on relative paths passed to absolute(File)Path

Change-Id: Id765f2e9ae3fdf17b1f16388caa5d09a17b87371
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
David Schulz
2021-09-09 06:45:37 +02:00
parent 6a435a3be9
commit ea215d612d

View File

@@ -839,6 +839,8 @@ FilePath FilePath::parentDir() const
FilePath FilePath::absolutePath() const
{
if (isAbsolutePath())
return parentDir();
QTC_ASSERT(!needsDevice(), return *this);
FilePath result = *this;
result.m_data = QFileInfo(m_data).absolutePath();
@@ -847,6 +849,8 @@ FilePath FilePath::absolutePath() const
FilePath FilePath::absoluteFilePath() const
{
if (isAbsolutePath())
return *this;
QTC_ASSERT(!needsDevice(), return *this);
FilePath result = *this;
result.m_data = QFileInfo(m_data).absoluteFilePath();