forked from qt-creator/qt-creator
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:
@@ -839,6 +839,8 @@ FilePath FilePath::parentDir() const
|
|||||||
|
|
||||||
FilePath FilePath::absolutePath() const
|
FilePath FilePath::absolutePath() const
|
||||||
{
|
{
|
||||||
|
if (isAbsolutePath())
|
||||||
|
return parentDir();
|
||||||
QTC_ASSERT(!needsDevice(), return *this);
|
QTC_ASSERT(!needsDevice(), return *this);
|
||||||
FilePath result = *this;
|
FilePath result = *this;
|
||||||
result.m_data = QFileInfo(m_data).absolutePath();
|
result.m_data = QFileInfo(m_data).absolutePath();
|
||||||
@@ -847,6 +849,8 @@ FilePath FilePath::absolutePath() const
|
|||||||
|
|
||||||
FilePath FilePath::absoluteFilePath() const
|
FilePath FilePath::absoluteFilePath() const
|
||||||
{
|
{
|
||||||
|
if (isAbsolutePath())
|
||||||
|
return *this;
|
||||||
QTC_ASSERT(!needsDevice(), return *this);
|
QTC_ASSERT(!needsDevice(), return *this);
|
||||||
FilePath result = *this;
|
FilePath result = *this;
|
||||||
result.m_data = QFileInfo(m_data).absoluteFilePath();
|
result.m_data = QFileInfo(m_data).absoluteFilePath();
|
||||||
|
Reference in New Issue
Block a user