From d2648d5f3f2c9315813dddfdc11110244f0562b9 Mon Sep 17 00:00:00 2001 From: Maks Naumov Date: Tue, 20 Oct 2015 07:54:36 +0300 Subject: QFileSystemModelPrivate::name(): avoid the double-lookup Change-Id: I67507248220fbbddc67ab60ecb1933e1fbacf5fd Reviewed-by: Marc Mutz --- src/widgets/dialogs/qfilesystemmodel.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/widgets/dialogs/qfilesystemmodel.cpp') diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index 2d8b8fadb1..70df7f305f 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -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; } -- cgit v1.2.3