Utils: Adapt to change in FilePath

Change-Id: Ie828342789e28d4b99138ac02d9e2644c5e24431
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2023-01-16 15:44:36 +01:00
parent 15cf2ecf25
commit 7b74432fb1

View File

@@ -1332,10 +1332,9 @@ void join(QString &left, const QString &right)
if (r.startsWith('/'))
r = r.mid(1);
if (left.isEmpty() || left.endsWith('/'))
if (!left.endsWith('/'))
left += '/';
left += r;
else
left += '/' + r;
}
FilePath FilePath::pathAppended(const QString &path) const
@@ -1343,13 +1342,14 @@ FilePath FilePath::pathAppended(const QString &path) const
if (path.isEmpty())
return *this;
FilePath other = FilePath::fromString(path);
QString other = path;
other.replace('\\', '/');
if (isEmpty())
return other;
return FilePath::fromString(other);
QString p = this->path();
join(p, other.path());
join(p, other);
return withNewPath(p);
}