X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2645b45a757dfd92214e8a395398982f4d1bb9fd..6c70a9b5948d72877e2b96c3ba381e834dea26b1:/src/generic/filedlgg.cpp diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp index 19570dec88..87eab5073c 100644 --- a/src/generic/filedlgg.cpp +++ b/src/generic/filedlgg.cpp @@ -409,8 +409,8 @@ wxFileData::wxFileData( const wxString &name, const wxString &fname ) } #endif - struct stat buff; - wxStat( m_fileName.fn_str(), &buff ); + wxStructStat buff; + wxStat( m_fileName, &buff ); #if defined(__UNIX__) && (!defined( __EMX__ ) && !defined(__VMS)) struct stat lbuff; @@ -437,10 +437,21 @@ wxFileData::wxFileData( const wxString &name, const wxString &fname ) m_year = t->tm_year; m_year += 1900; - m_permissions.sprintf( wxT("%c%c%c"), - ((( buff.st_mode & S_IRUSR ) == S_IRUSR ) ? wxT('r') : wxT('-')), - ((( buff.st_mode & S_IWUSR ) == S_IWUSR ) ? wxT('w') : wxT('-')), - ((( buff.st_mode & S_IXUSR ) == S_IXUSR ) ? wxT('x') : wxT('-')) ); + char buffer[10]; + sprintf( buffer, "%c%c%c", + ((( buff.st_mode & S_IRUSR ) == S_IRUSR ) ? 'r' : '-'), + ((( buff.st_mode & S_IWUSR ) == S_IWUSR ) ? 'w' : '-'), + ((( buff.st_mode & S_IXUSR ) == S_IXUSR ) ? 'x' : '-') ); +#if wxUSE_UNICODE + m_permissions = wxConvUTF8.cMB2WC( buffer ); +#else + m_permissions = buffer; +#endif + +// m_permissions.sprintf( wxT("%c%c%c"), +// ((( buff.st_mode & S_IRUSR ) == S_IRUSR ) ? wxT('r') : wxT('-')), +// ((( buff.st_mode & S_IWUSR ) == S_IWUSR ) ? wxT('w') : wxT('-')), +// ((( buff.st_mode & S_IXUSR ) == S_IXUSR ) ? wxT('x') : wxT('-')) ); } wxString wxFileData::GetName() const @@ -1211,6 +1222,14 @@ wxFileDialog::~wxFileDialog() } } +void wxFileDialog::SetFilterIndex( int filterindex ) +{ + m_choice->SetSelection( filterindex ); + wxCommandEvent event; + event.SetInt( filterindex ); + OnChoice( event ); +} + void wxFileDialog::OnChoice( wxCommandEvent &event ) { int index = (int)event.GetInt();