summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2010-02-01 12:17:51 (GMT)
committerJens Bache-Wiig <jbache@trolltech.com>2010-02-01 12:21:06 (GMT)
commitb67bd25be08b54c3e6e49b2b9429e54ff58db268 (patch)
tree7d209dca4540123cd79c8d67ba6f9db95c8678d2 /src/gui
parent4beac591e47713121ad00ef3df744f7f4d11f2fd (diff)
downloadQt-b67bd25be08b54c3e6e49b2b9429e54ff58db268.zip
Qt-b67bd25be08b54c3e6e49b2b9429e54ff58db268.tar.gz
Qt-b67bd25be08b54c3e6e49b2b9429e54ff58db268.tar.bz2
Fix a problem with overlay icons in the fileiconprovider
Adding SHGFI_OVERLAYINDEX will append a system overlay identifier to the hIcon member, giving us a unique cache id for overlayed icons. Without this we could end up with having random overlays on icons depending on which one we loaded first. Task-number: QTBUG-7663 Reviewed-by: prasanth
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/itemviews/qfileiconprovider.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/itemviews/qfileiconprovider.cpp b/src/gui/itemviews/qfileiconprovider.cpp
index 360ed14..fcc61e5 100644
--- a/src/gui/itemviews/qfileiconprovider.cpp
+++ b/src/gui/itemviews/qfileiconprovider.cpp
@@ -65,6 +65,7 @@
#ifndef SHGFI_ADDOVERLAYS
# define SHGFI_ADDOVERLAYS 0x000000020
+# define SHGFI_OVERLAYINDEX 0x000000040
#endif
QT_BEGIN_NAMESPACE
@@ -248,7 +249,7 @@ QIcon QFileIconProviderPrivate::getWinIcon(const QFileInfo &fileInfo) const
//Get the small icon
#ifndef Q_OS_WINCE
val = SHGetFileInfo((const wchar_t *)QDir::toNativeSeparators(fileInfo.filePath()).utf16(), 0, &info,
- sizeof(SHFILEINFO), SHGFI_ICON|SHGFI_SMALLICON|SHGFI_SYSICONINDEX|SHGFI_ADDOVERLAYS);
+ sizeof(SHFILEINFO), SHGFI_ICON|SHGFI_SMALLICON|SHGFI_SYSICONINDEX|SHGFI_ADDOVERLAYS|SHGFI_OVERLAYINDEX);
#else
val = SHGetFileInfo((const wchar_t *)QDir::toNativeSeparators(fileInfo.filePath()).utf16(), 0, &info,
sizeof(SHFILEINFO), SHGFI_SMALLICON|SHGFI_SYSICONINDEX);
@@ -287,7 +288,7 @@ QIcon QFileIconProviderPrivate::getWinIcon(const QFileInfo &fileInfo) const
//Get the big icon
#ifndef Q_OS_WINCE
val = SHGetFileInfo((const wchar_t *)QDir::toNativeSeparators(fileInfo.filePath()).utf16(), 0, &info,
- sizeof(SHFILEINFO), SHGFI_ICON|SHGFI_LARGEICON|SHGFI_SYSICONINDEX|SHGFI_ADDOVERLAYS);
+ sizeof(SHFILEINFO), SHGFI_ICON|SHGFI_LARGEICON|SHGFI_SYSICONINDEX|SHGFI_ADDOVERLAYS|SHGFI_OVERLAYINDEX);
#else
val = SHGetFileInfo((const wchar_t *)QDir::toNativeSeparators(fileInfo.filePath()).utf16(), 0, &info,
sizeof(SHFILEINFO), SHGFI_LARGEICON|SHGFI_SYSICONINDEX);