QFileSystemEngine: Minor cleanup in unix

Change-Id: I4a123484ea1f5e53af85a52e86d4a80cef1cd7bc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Orgad Shaneh 2017-08-27 11:23:39 +03:00 committed by Orgad Shaneh
parent eb2e984da1
commit 8805fdb391

View File

@ -638,13 +638,8 @@ QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link,
}
ret += QFile::decodeName(s);
if (!ret.startsWith(QLatin1Char('/'))) {
const QString linkPath = link.path();
if (linkPath.startsWith(QLatin1Char('/')))
ret.prepend(linkPath + QLatin1Char('/'));
else
ret.prepend(QDir::currentPath() + QLatin1Char('/') + linkPath + QLatin1Char('/'));
}
if (!ret.startsWith(QLatin1Char('/')))
ret.prepend(absoluteName(link).path() + QLatin1Char('/'));
ret = QDir::cleanPath(ret);
if (ret.size() > 1 && ret.endsWith(QLatin1Char('/')))
ret.chop(1);