diff options
author | Sérgio Martins <sergio.martins@kdab.com> | 2013-04-29 12:58:23 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-09 14:56:32 +0200 |
commit | 46685f755b01288fd53c4483cb97a22c426a57f0 (patch) | |
tree | b18c0a65dd82dd7717879dafa34e3b04c11c2e4b /src/widgets/itemviews/qfileiconprovider.h | |
parent | 0e9ea64edcdb451ffcfbf055174354e6c8f2df88 (diff) |
Windows: Introduce QFileDialog::DontUseCustomDirectoryIcons
Folders can have a custom icon, set by the user. Some system
folders also have one, for example c:\windows\fonts.
This option allows you to disable this behavior, you'll get the
folder directory icon.
As a side-effect, you'll get a very big performance improvement
on removable/network media: 2 seconds vs 60 seconds on a SDCard
with 10000 folders.
Change-Id: Id55ea628186e0a6523585ec7a4ff622d6f5da505
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/widgets/itemviews/qfileiconprovider.h')
-rw-r--r-- | src/widgets/itemviews/qfileiconprovider.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/widgets/itemviews/qfileiconprovider.h b/src/widgets/itemviews/qfileiconprovider.h index cac135fe71..ed270619ed 100644 --- a/src/widgets/itemviews/qfileiconprovider.h +++ b/src/widgets/itemviews/qfileiconprovider.h @@ -59,10 +59,19 @@ public: QFileIconProvider(); virtual ~QFileIconProvider(); enum IconType { Computer, Desktop, Trashcan, Network, Drive, Folder, File }; + + enum Option { + DontUseCustomDirectoryIcons = 0x00000001 + }; + Q_DECLARE_FLAGS(Options, Option) + virtual QIcon icon(IconType type) const; virtual QIcon icon(const QFileInfo &info) const; virtual QString type(const QFileInfo &info) const; + void setOptions(Options options); + Options options() const; + private: Q_DECLARE_PRIVATE(QFileIconProvider) QScopedPointer<QFileIconProviderPrivate> d_ptr; @@ -71,6 +80,8 @@ private: #endif // QT_NO_FILEICONPROVIDER +Q_DECLARE_OPERATORS_FOR_FLAGS(QFileIconProvider::Options) + QT_END_NAMESPACE #endif // QFILEICONPROVIDER_H |