summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qfileinfogatherer_p.h
diff options
context:
space:
mode:
authorSérgio Martins <sergio.martins@kdab.com>2013-03-26 11:47:38 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-27 14:26:09 +0100
commit9149f31aeaf3fce0c5ba5c20da0b9f2b56368abb (patch)
tree9006a5c8825d11c5a30d2f4fc5ff0b8f3fdec87c /src/widgets/dialogs/qfileinfogatherer_p.h
parent5d12417c94579fcbed3beb40b03f4309e7a44e79 (diff)
Windows: Fix the last file dialog bottleneck.
Went from taking 30 seconds to 2 seconds, on a SDCard with 10k files. Windows file dialog does not resolve NTFS symlinks, it just shows an empty icon, and the link name, not the target. This allows for a big performance gain by reducing the number of calls to GetFileAttributesEx() by checking the extension directly. This also fixes the problems with the native file dialog, which for some reason, is creating a QFileSystemModel too. Task-number: QTBUG-13182 Change-Id: Ie2739765fd6c7daea64e3cf1d208ba9720bd39f2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/widgets/dialogs/qfileinfogatherer_p.h')
-rw-r--r--src/widgets/dialogs/qfileinfogatherer_p.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/widgets/dialogs/qfileinfogatherer_p.h b/src/widgets/dialogs/qfileinfogatherer_p.h
index 0c4e644e40..447ee78edc 100644
--- a/src/widgets/dialogs/qfileinfogatherer_p.h
+++ b/src/widgets/dialogs/qfileinfogatherer_p.h
@@ -108,7 +108,13 @@ public:
return QExtendedInformation::System;
}
- bool isSymLink() const {
+ bool isSymLink(bool ignoreNtfsSymLinks = false) const
+ {
+ if (ignoreNtfsSymLinks) {
+#ifdef Q_OS_WIN
+ return !mFileInfo.suffix().compare(QLatin1String("lnk"), Qt::CaseInsensitive);
+#endif
+ }
return mFileInfo.isSymLink();
}