Fix issue #44 - Problems browsing files when "hide extensions for known file types" is enable.

As IShellFolder::GetAttributesOf() method returns attributes that are
common to all of the specified items, we cannot request attributes for
several items at the same time, so we've to request them one by one for
each item.
This commit is contained in:
David Capello 2012-07-09 13:46:14 -03:00
parent cd23721a97
commit 420a46f689

View File

@ -482,13 +482,9 @@ const FileItemList& FileItem::getChildren()
while (pEnum->Next(256, itempidl, &fetched) == S_OK && fetched > 0) { while (pEnum->Next(256, itempidl, &fetched) == S_OK && fetched > 0) {
/* request the SFGAO_FOLDER attribute to know what of the /* request the SFGAO_FOLDER attribute to know what of the
item is a folder */ item is a folder */
for (c=0; c<fetched; ++c) for (c=0; c<fetched; ++c) {
attribs[c] = SFGAO_FOLDER; attribs[c] = SFGAO_FOLDER;
pFolder->GetAttributesOf(1, (LPCITEMIDLIST *)itempidl, attribs+c);
if (pFolder->GetAttributesOf(fetched,
(LPCITEMIDLIST *)itempidl, attribs) != S_OK) {
for (c=0; c<fetched; ++c)
attribs[c] = 0;
} }
/* generate the FileItems */ /* generate the FileItems */