forked from qt-creator/qt-creator
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:
@@ -1332,10 +1332,9 @@ void join(QString &left, const QString &right)
|
|||||||
if (r.startsWith('/'))
|
if (r.startsWith('/'))
|
||||||
r = r.mid(1);
|
r = r.mid(1);
|
||||||
|
|
||||||
if (left.isEmpty() || left.endsWith('/'))
|
if (!left.endsWith('/'))
|
||||||
left += r;
|
left += '/';
|
||||||
else
|
left += r;
|
||||||
left += '/' + r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePath FilePath::pathAppended(const QString &path) const
|
FilePath FilePath::pathAppended(const QString &path) const
|
||||||
@@ -1343,13 +1342,14 @@ FilePath FilePath::pathAppended(const QString &path) const
|
|||||||
if (path.isEmpty())
|
if (path.isEmpty())
|
||||||
return *this;
|
return *this;
|
||||||
|
|
||||||
FilePath other = FilePath::fromString(path);
|
QString other = path;
|
||||||
|
other.replace('\\', '/');
|
||||||
|
|
||||||
if (isEmpty())
|
if (isEmpty())
|
||||||
return other;
|
return FilePath::fromString(other);
|
||||||
|
|
||||||
QString p = this->path();
|
QString p = this->path();
|
||||||
join(p, other.path());
|
join(p, other);
|
||||||
|
|
||||||
return withNewPath(p);
|
return withNewPath(p);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user