Utils: Add a FilePath::isDir() convenience function

Change-Id: I1df0ee1b136299ae6e4f2e5bd0bdc24bfeca33dd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2019-05-28 16:55:43 +02:00
parent bf6fd00163
commit ddf0dd8734
14 changed files with 21 additions and 15 deletions

View File

@@ -936,6 +936,12 @@ bool FilePath::isLocal() const
return m_url.isEmpty() || m_url.isLocalFile();
}
bool FilePath::isDir() const
{
QTC_CHECK(m_url.isEmpty()); // FIXME: Not implemented yet.
return QFileInfo(m_data).isDir();
}
/// \returns the relativeChildPath of FilePath to parent if FilePath is a child of parent
/// \note returns a empty FilePath if FilePath is not a child of parent
/// That is, this never returns a path starting with "../"