QFileSystemModelPrivate::name(): avoid the double-lookup

Change-Id: I67507248220fbbddc67ab60ecb1933e1fbacf5fd
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
Maks Naumov 2015-10-20 07:54:36 +03:00
parent bfb6a8cd44
commit d2648d5f3f

View File

@ -796,8 +796,7 @@ QString QFileSystemModelPrivate::name(const QModelIndex &index) const
#endif
!resolvedSymLinks.isEmpty() && dirNode->isSymLink(/* ignoreNtfsSymLinks = */ true)) {
QString fullPath = QDir::fromNativeSeparators(filePath(index));
if (resolvedSymLinks.contains(fullPath))
return resolvedSymLinks.value(fullPath);
return resolvedSymLinks.value(fullPath, dirNode->fileName);
}
return dirNode->fileName;
}