diff options
author | Sérgio Martins <sergio.martins@kdab.com> | 2013-03-11 17:39:17 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-13 18:38:19 +0100 |
commit | 1975e65d73ef2bf225bd765e6b50b6f50167f71c (patch) | |
tree | 290a914cf8342d08e184f7f703cbf06b7a3c0511 /src/widgets/dialogs | |
parent | e3c5351d06ce8a12f035cd0627356bc64d8c334a (diff) |
Reorder for performance reasons.
isSymLink() can be expensive in a few cases.
Change-Id: I6f84414cf7057453d62225ab4f45dcdf92ed017b
Reviewed-by: David Faure (KDE) <faure@kde.org>
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r-- | src/widgets/dialogs/qfileinfogatherer.cpp | 2 | ||||
-rw-r--r-- | src/widgets/dialogs/qfilesystemmodel.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp index fc86576f55..98cde84450 100644 --- a/src/widgets/dialogs/qfileinfogatherer.cpp +++ b/src/widgets/dialogs/qfileinfogatherer.cpp @@ -238,7 +238,7 @@ QExtendedInformation QFileInfoGatherer::getInfo(const QFileInfo &fileInfo) const #endif #ifdef Q_OS_WIN - if (fileInfo.isSymLink() && m_resolveSymlinks) { + if (m_resolveSymlinks && fileInfo.isSymLink()) { QFileInfo resolvedInfo(fileInfo.symLinkTarget()); resolvedInfo = resolvedInfo.canonicalFilePath(); if (resolvedInfo.exists()) { diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index 4d3c7a24ec..9a81e0f02f 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -800,7 +800,7 @@ QString QFileSystemModelPrivate::name(const QModelIndex &index) const if (!index.isValid()) return QString(); QFileSystemNode *dirNode = node(index); - if (dirNode->isSymLink() && fileInfoGatherer.resolveSymlinks()) { + if (fileInfoGatherer.resolveSymlinks() && !resolvedSymLinks.isEmpty() && dirNode->isSymLink()) { QString fullPath = QDir::fromNativeSeparators(filePath(index)); if (resolvedSymLinks.contains(fullPath)) return resolvedSymLinks[fullPath]; |