forked from qt-creator/qt-creator
Utils: Remove internal /./ relative path marker
Some creeped into settings earlier, making the paths that were meant to be empty look non-empty. Also add a test for FilePath::isEmpty(). Change-Id: I99e3dd673294206558f9fee9b7c7874d2441327e Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -343,15 +343,17 @@ QStringView FilePath::host() const
|
||||
|
||||
QString FilePath::path() const
|
||||
{
|
||||
if (m_data.startsWith("/./"))
|
||||
return m_data.mid(3, m_pathLen - 3);
|
||||
QTC_ASSERT(!m_data.startsWith(u"/./"), return m_data.mid(3, m_pathLen - 3));
|
||||
return m_data.left(m_pathLen);
|
||||
}
|
||||
|
||||
void FilePath::setParts(const QStringView scheme, const QStringView host, const QStringView path)
|
||||
void FilePath::setParts(const QStringView scheme, const QStringView host, QStringView path)
|
||||
{
|
||||
QTC_CHECK(!scheme.contains('/'));
|
||||
|
||||
if (path.startsWith(u"/./"))
|
||||
path = path.mid(3);
|
||||
|
||||
m_data = path.toString() + scheme.toString() + host.toString();
|
||||
m_schemeLen = scheme.size();
|
||||
m_hostLen = host.size();
|
||||
|
||||
Reference in New Issue
Block a user