summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs/qfileinfogatherer_p.h
diff options
context:
space:
mode:
authorSergio Martins <sergio.martins@kdab.com>2013-03-27 18:30:44 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-28 16:06:45 (GMT)
commit7f1197a689deae502129148be94b63c246962b8f (patch)
tree3ba8a60a633fe24f4e301ccba920038351abf62b /src/gui/dialogs/qfileinfogatherer_p.h
parentac69080efd0f0efea50e08b8f2f9550befd3b7ae (diff)
downloadQt-7f1197a689deae502129148be94b63c246962b8f.zip
Qt-7f1197a689deae502129148be94b63c246962b8f.tar.gz
Qt-7f1197a689deae502129148be94b63c246962b8f.tar.bz2
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 (cherry picked from commit 51f00deffac49c4277425837f0132b0c721bb689) Change-Id: If7bd63d68e1870c5e48907ae79f4c4bdc6972b00 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/gui/dialogs/qfileinfogatherer_p.h')
-rw-r--r--src/gui/dialogs/qfileinfogatherer_p.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/dialogs/qfileinfogatherer_p.h b/src/gui/dialogs/qfileinfogatherer_p.h
index 539f52d..5f89ddd 100644
--- a/src/gui/dialogs/qfileinfogatherer_p.h
+++ b/src/gui/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_WS_WIN
+ return !mFileInfo.suffix().compare(QLatin1String("lnk"), Qt::CaseInsensitive);
+#endif
+ }
return mFileInfo.isSymLink();
}