Change the way directory iteration flags are constructed.

Instead of explicitly constructing the flags from the flags that should be
included, construct them by excluding the flags that shouldn't be used. This
makes the code more stable in the sense that it will continue to work when new
flags, such as the upcoming wxDIR_NO_FOLLOW, are added.

See #14542.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72739 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-10-23 23:57:07 +00:00
parent e264485aac
commit 6bf11d6720

View File

@@ -115,7 +115,9 @@ size_t wxDir::Traverse(wxDirTraverser& sink,
if ( flags & wxDIR_DIRS )
{
wxString dirname;
for ( bool cont = GetFirst(&dirname, wxEmptyString, wxDIR_DIRS | (flags & wxDIR_HIDDEN) );
for ( bool cont = GetFirst(&dirname, wxEmptyString,
(flags & ~(wxDIR_FILES | wxDIR_DOTDOT))
| wxDIR_DIRS);
cont;
cont = cont && GetNext(&dirname) )
{