From 7b74432fb1041c5153d80f6a64eedaf7fe032a0e Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 16 Jan 2023 15:44:36 +0100 Subject: [PATCH] Utils: Adapt to change in FilePath Change-Id: Ie828342789e28d4b99138ac02d9e2644c5e24431 Reviewed-by: Reviewed-by: hjk --- src/libs/utils/filepath.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index c100ef70471..a724026852f 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -1332,10 +1332,9 @@ void join(QString &left, const QString &right) if (r.startsWith('/')) r = r.mid(1); - if (left.isEmpty() || left.endsWith('/')) - left += r; - else - left += '/' + r; + if (!left.endsWith('/')) + left += '/'; + 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); }