Reorder for performance reasons.
isSymLink() can be expensive in a few cases. Change-Id: I6f84414cf7057453d62225ab4f45dcdf92ed017b Reviewed-by: David Faure (KDE) <faure@kde.org>bb10
parent
e3c5351d06
commit
1975e65d73
|
|
@ -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()) {
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Reference in New Issue