diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-01 13:09:51 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-01 13:09:51 (GMT) |
commit | 8feb69b5b59aa697793c377cc79afd9e873e2d6d (patch) | |
tree | 6d94713fd2f7d22c16fc0acfcc8f01e96b5c1759 /src | |
parent | f2625271f7c878c00fea38291cd11c34c80550fa (diff) | |
parent | 3e287de62f677dd0a88d2fa9299059025f2db546 (diff) | |
download | Qt-8feb69b5b59aa697793c377cc79afd9e873e2d6d.zip Qt-8feb69b5b59aa697793c377cc79afd9e873e2d6d.tar.gz Qt-8feb69b5b59aa697793c377cc79afd9e873e2d6d.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
Fix crash in the fileiconprovider for Windows
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/itemviews/qfileiconprovider.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/itemviews/qfileiconprovider.cpp b/src/gui/itemviews/qfileiconprovider.cpp index fcc61e5..673065c 100644 --- a/src/gui/itemviews/qfileiconprovider.cpp +++ b/src/gui/itemviews/qfileiconprovider.cpp @@ -254,7 +254,9 @@ QIcon QFileIconProviderPrivate::getWinIcon(const QFileInfo &fileInfo) const val = SHGetFileInfo((const wchar_t *)QDir::toNativeSeparators(fileInfo.filePath()).utf16(), 0, &info, sizeof(SHFILEINFO), SHGFI_SMALLICON|SHGFI_SYSICONINDEX); #endif - if (val) { + + // Even if GetFileInfo returns a valid result, hIcon can be empty in some cases + if (val && info.hIcon) { if (fileInfo.isDir() && !fileInfo.isRoot()) { //using the unique icon index provided by windows save us from duplicate keys key = QString::fromLatin1("qt_dir_%1").arg(info.iIcon); @@ -293,7 +295,7 @@ QIcon QFileIconProviderPrivate::getWinIcon(const QFileInfo &fileInfo) const val = SHGetFileInfo((const wchar_t *)QDir::toNativeSeparators(fileInfo.filePath()).utf16(), 0, &info, sizeof(SHFILEINFO), SHGFI_LARGEICON|SHGFI_SYSICONINDEX); #endif - if (val) { + if (val && info.hIcon) { if (fileInfo.isDir() && !fileInfo.isRoot()) { //using the unique icon index provided by windows save us from duplicate keys key = QString::fromLatin1("qt_dir_%1").arg(info.iIcon); |