summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs
diff options
context:
space:
mode:
authorSérgio Martins <sergio.martins@kdab.com>2013-03-11 17:39:17 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-19 20:02:15 (GMT)
commit6081658ce5e8c7c04ccd8592f5a110107db12a5e (patch)
treefa6f30e690a47a8457a6d022e639fe7f63882259 /src/gui/dialogs
parentcf19118e8fef7979343bc7788a3ed55abfec3bd0 (diff)
downloadQt-6081658ce5e8c7c04ccd8592f5a110107db12a5e.zip
Qt-6081658ce5e8c7c04ccd8592f5a110107db12a5e.tar.gz
Qt-6081658ce5e8c7c04ccd8592f5a110107db12a5e.tar.bz2
Reorder for performance reasons.
isSymLink() can be expensive in a few cases. Change-Id: Ib8b9f0c13d7ce141a539a4729be81d9faa4382ea Reviewed-by: David Faure (KDE) <faure@kde.org> (cherry picked from commit 1975e65d73ef2bf225bd765e6b50b6f50167f71c) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/gui/dialogs')
-rw-r--r--src/gui/dialogs/qfileinfogatherer.cpp2
-rw-r--r--src/gui/dialogs/qfilesystemmodel.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/dialogs/qfileinfogatherer.cpp b/src/gui/dialogs/qfileinfogatherer.cpp
index 00769f6..d58a183 100644
--- a/src/gui/dialogs/qfileinfogatherer.cpp
+++ b/src/gui/dialogs/qfileinfogatherer.cpp
@@ -248,7 +248,7 @@ QExtendedInformation QFileInfoGatherer::getInfo(const QFileInfo &fileInfo) const
#endif
#endif
- if (fileInfo.isSymLink() && m_resolveSymlinks) {
+ if (m_resolveSymlinks && fileInfo.isSymLink()) {
QFileInfo resolvedInfo(fileInfo.symLinkTarget());
resolvedInfo = resolvedInfo.canonicalFilePath();
if (resolvedInfo.exists()) {
diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp
index 76a38c2..8007c4e 100644
--- a/src/gui/dialogs/qfilesystemmodel.cpp
+++ b/src/gui/dialogs/qfilesystemmodel.cpp
@@ -803,7 +803,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];