diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-04-09 12:23:53 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-04-09 12:23:53 (GMT) |
commit | 850c3f7d9bb5fbad041dd935d1d53c5d49db0163 (patch) | |
tree | 3ebb00088919d21c51c34b3c002c41b3fd1bedbe /src/gui/itemviews/qfileiconprovider.cpp | |
parent | 19a566f82a7c684423331a8caab70ec594afd1ce (diff) | |
parent | 64a360f45ab9a1c50ca628cfd6b670b93816c756 (diff) | |
download | Qt-850c3f7d9bb5fbad041dd935d1d53c5d49db0163.zip Qt-850c3f7d9bb5fbad041dd935d1d53c5d49db0163.tar.gz Qt-850c3f7d9bb5fbad041dd935d1d53c5d49db0163.tar.bz2 |
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts:
src/multimedia/audio/qaudioinput_win32_p.h
Diffstat (limited to 'src/gui/itemviews/qfileiconprovider.cpp')
-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 f321ab3..5dbd1f0 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); |