]> git.saurik.com Git - wxWidgets.git/commitdiff
Change the way directory iteration flags are constructed.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 23 Oct 2012 23:57:07 +0000 (23:57 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 23 Oct 2012 23:57:07 +0000 (23:57 +0000)
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

src/common/dircmn.cpp

index 1638cff0ac40a0b1637718a324555fe1c40e9a87..7faa5bb3ea9a2da53a448728226172896444d8b0 100644 (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) )
         {