From 9149f31aeaf3fce0c5ba5c20da0b9f2b56368abb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Tue, 26 Mar 2013 11:47:38 +0000 Subject: 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 Reviewed-by: Joerg Bornemann --- src/widgets/dialogs/qfileinfogatherer_p.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/widgets/dialogs/qfileinfogatherer_p.h') 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(); } -- cgit v1.2.3