diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index 0767542066e..dcc5c6fac6a 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -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();