X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0d853c5412a1628f1bcad5f9043050e7cf105ac7..002ed9af8309d5baa1b2c32f1fd28160595e2fa7:/src/generic/dirctrlg.cpp diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index 28e393d177..660128edf2 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -818,7 +818,7 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId) dirs.Add(eachFilename); } } - while (d.GetNext(& eachFilename)); + while (d.GetNext(&eachFilename)); } } dirs.Sort(wxDirCtrlStringCompareFunction); @@ -832,16 +832,26 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId) if (d.IsOpened()) { - if (d.GetFirst(& eachFilename, m_currentFilterStr, wxDIR_FILES)) + int style = wxDIR_FILES; + if (m_showHidden) style |= wxDIR_HIDDEN; + // Process each filter (ex: "JPEG Files (*.jpg;*.jpeg)|*.jpg;*.jpeg") + wxStringTokenizer strTok; + wxString curFilter; + strTok.SetString(m_currentFilterStr,wxT(";")); + while(strTok.HasMoreTokens()) { - do + curFilter = strTok.GetNextToken(); + if (d.GetFirst(& eachFilename, m_currentFilterStr, style)) { - if ((eachFilename != wxT(".")) && (eachFilename != wxT(".."))) + do { - filenames.Add(eachFilename); + if ((eachFilename != wxT(".")) && (eachFilename != wxT(".."))) + { + filenames.Add(eachFilename); + } } + while (d.GetNext(& eachFilename)); } - while (d.GetNext(& eachFilename)); } } filenames.Sort(wxDirCtrlStringCompareFunction); @@ -1631,9 +1641,13 @@ int wxFileIconsTable::GetIconID(const wxString& extension, const wxString& mime) wxIconLocation iconLoc; wxIcon ic; - if ( ft && ft->GetIcon(&iconLoc) ) + { - ic = wxIcon(iconLoc); + wxLogNull logNull; + if ( ft && ft->GetIcon(&iconLoc) ) + { + ic = wxIcon(iconLoc); + } } delete ft; @@ -1645,16 +1659,24 @@ int wxFileIconsTable::GetIconID(const wxString& extension, const wxString& mime) return newid; } - wxBitmap tmpBmp; - tmpBmp.CopyFromIcon(ic); - wxImage img = tmpBmp.ConvertToImage(); + wxBitmap bmp; + bmp.CopyFromIcon(ic); + + if ( !bmp.Ok() ) + { + int newid = file; + m_HashTable->Put(extension, new wxFileIconEntry(newid)); + return newid; + } int id = m_smallImageList->GetImageCount(); - if (img.GetWidth() == 16 && img.GetHeight() == 16) - m_smallImageList->Add(wxBitmap(img)); + if ((bmp.GetWidth() == 16) && (bmp.GetHeight() == 16)) + m_smallImageList->Add(bmp); else { - if (img.GetWidth() != 32 || img.GetHeight() != 32) + wxImage img = bmp.ConvertToImage(); + + if ((img.GetWidth() != 32) || (img.GetHeight() != 32)) m_smallImageList->Add(CreateAntialiasedBitmap(CutEmptyBorders(img).Rescale(32, 32))); else m_smallImageList->Add(CreateAntialiasedBitmap(img));