- if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) != 0 && (m_flags & wxDIR_DIRS) ) // we have a directory
- break ;
-
- if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) == 0 && !(m_flags & wxDIR_FILES ) ) // its a file but we don't want it
- continue ;
-
- if ( ( m_CPB.hFileInfo.ioFlFndrInfo.fdFlags & kIsInvisible ) && !(m_flags & wxDIR_HIDDEN) ) // its hidden but we don't want it
- continue ;
-
- wxString file( m_name ) ;
- if ( m_filespec.IsEmpty() || m_filespec == "*.*" )
- {
- }
- else if ( m_filespec.Length() > 1 && m_filespec.Left(1) =="*" )
- {
- if ( file.Right( m_filespec.Length() - 1 ).Upper() != m_filespec.Mid(1).Upper() )
- {
- continue ;
- }
- }
- else if ( m_filespec.Length() > 1 && m_filespec.Right(1) == "*" )
- {
- if ( file.Left( m_filespec.Length() - 1 ).Upper() != m_filespec.Left( m_filespec.Length() - 1 ).Upper() )
- {
- continue ;
- }
- }
- else if ( file.Upper() != m_filespec.Upper() )
- {
- continue ;
- }
-
- break ;
- }
- if ( err != noErr )
- {
- return FALSE ;
- }
-
- *filename = (char*) m_name ;
+ // its hidden but we don't want it
+ if ( ( m_CPB.hFileInfo.ioFlFndrInfo.fdFlags & kIsInvisible ) && !(m_flags & wxDIR_HIDDEN) )
+ continue ;
+#ifdef __DARWIN__
+ // under X, names that start with '.' are hidden
+ if ( ( m_name[0] == '.' ) && !(m_flags & wxDIR_HIDDEN) )
+ continue;
+#endif
+#if TARGET_CARBON
+ // under X thats the way the mounting points look like
+ if ( ( m_CPB.dirInfo.ioDrDirID == 0 ) && ( m_flags & wxDIR_DIRS) )
+ break ;
+#endif
+ // we have a directory
+ if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) != 0 && (m_flags & wxDIR_DIRS) )
+ break ;
+
+ // its a file but we don't want it
+ if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) == 0 && !(m_flags & wxDIR_FILES ) )
+ continue ;
+
+ wxString file( m_name ) ;
+ if ( m_filespec.IsEmpty() || m_filespec == "*.*" || m_filespec == "*" )
+ {
+ }
+ else if ( m_filespec.Length() > 1 && m_filespec.Left(1) =="*" )
+ {
+ if ( file.Right( m_filespec.Length() - 1 ).Upper() != m_filespec.Mid(1).Upper() )
+ {
+ continue ;
+ }
+ }
+ else if ( m_filespec.Length() > 1 && m_filespec.Right(1) == "*" )
+ {
+ if ( file.Left( m_filespec.Length() - 1 ).Upper() != m_filespec.Left( m_filespec.Length() - 1 ).Upper() )
+ {
+ continue ;
+ }
+ }
+ else if ( file.Upper() != m_filespec.Upper() )
+ {
+ continue ;
+ }
+
+ break ;
+ }
+ if ( err != noErr )
+ {
+ return FALSE ;
+ }
+
+ *filename = (char*) m_name ;