Improved string concat to avoid "//" in paths

This commit is contained in:
Klaus Basan
2019-06-29 03:40:20 +02:00
committed by Mat Sutcliffe
parent fa8eed1611
commit 458daa4532
2 changed files with 10 additions and 3 deletions

View File

@@ -53,8 +53,8 @@ namespace BlackMisc
QString CUrl::appendPath(const QString &pathToAppend)
{
QString p(getPath());
p = p.append("/").append(pathToAppend.trimmed()).replace("//", "/");
if (pathToAppend.isEmpty()) { return m_path; }
const QString p = CFileUtils::appendFilePaths(this->getPath(), pathToAppend);
this->setPath(p);
return m_path;
}