Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/itemviews/qfileiconprovider.cpp

    r651 r769  
    6969#ifndef SHGFI_ADDOVERLAYS
    7070#  define SHGFI_ADDOVERLAYS 0x000000020
     71#  define SHGFI_OVERLAYINDEX 0x000000040
    7172#endif
    7273
     
    254255#ifndef Q_OS_WINCE
    255256    val = SHGetFileInfo((const wchar_t *)QDir::toNativeSeparators(fileInfo.filePath()).utf16(), 0, &info,
    256                         sizeof(SHFILEINFO), SHGFI_ICON|SHGFI_SMALLICON|SHGFI_SYSICONINDEX|SHGFI_ADDOVERLAYS);
     257                        sizeof(SHFILEINFO), SHGFI_ICON|SHGFI_SMALLICON|SHGFI_SYSICONINDEX|SHGFI_ADDOVERLAYS|SHGFI_OVERLAYINDEX);
    257258#else
    258259    val = SHGetFileInfo((const wchar_t *)QDir::toNativeSeparators(fileInfo.filePath()).utf16(), 0, &info,
    259260                        sizeof(SHFILEINFO), SHGFI_SMALLICON|SHGFI_SYSICONINDEX);
    260261#endif
    261     if (val) {
     262
     263    // Even if GetFileInfo returns a valid result, hIcon can be empty in some cases
     264    if (val && info.hIcon) {
    262265        if (fileInfo.isDir() && !fileInfo.isRoot()) {
    263266            //using the unique icon index provided by windows save us from duplicate keys
     
    293296#ifndef Q_OS_WINCE
    294297    val = SHGetFileInfo((const wchar_t *)QDir::toNativeSeparators(fileInfo.filePath()).utf16(), 0, &info,
    295                         sizeof(SHFILEINFO), SHGFI_ICON|SHGFI_LARGEICON|SHGFI_SYSICONINDEX|SHGFI_ADDOVERLAYS);
     298                        sizeof(SHFILEINFO), SHGFI_ICON|SHGFI_LARGEICON|SHGFI_SYSICONINDEX|SHGFI_ADDOVERLAYS|SHGFI_OVERLAYINDEX);
    296299#else
    297300    val = SHGetFileInfo((const wchar_t *)QDir::toNativeSeparators(fileInfo.filePath()).utf16(), 0, &info,
    298301                        sizeof(SHFILEINFO), SHGFI_LARGEICON|SHGFI_SYSICONINDEX);
    299302#endif
    300     if (val) {
     303    if (val && info.hIcon) {
    301304        if (fileInfo.isDir() && !fileInfo.isRoot()) {
    302305            //using the unique icon index provided by windows save us from duplicate keys
Note: See TracChangeset for help on using the changeset viewer.