X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4e1901b70e569df706866afb12aa5cf2b058963d..040e5f77e6f7f177bdc74b90327c22908d56fe59:/src/generic/filedlgg.cpp diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp index 2b482b1356..334e2370df 100644 --- a/src/generic/filedlgg.cpp +++ b/src/generic/filedlgg.cpp @@ -140,7 +140,7 @@ int wxCALLBACK wxFileDataTimeCompare( long data1, long data2, long data) #endif #if defined(__DOS__) || defined(__WINDOWS__) || defined (__OS2__) -#define IsTopMostDir(dir) (dir.IsEmpty()) +#define IsTopMostDir(dir) (dir.empty()) #endif #if defined(__DOS__) || defined(__WINDOWS__) || defined(__OS2__) @@ -157,6 +157,7 @@ extern size_t wxGetAvailableDrives(wxArrayString &paths, wxArrayString &names, w wxFileData::wxFileData( const wxString &filePath, const wxString &fileName, fileType type, int image_id ) { + Init(); m_fileName = fileName; m_filePath = filePath; m_type = type; @@ -165,6 +166,13 @@ wxFileData::wxFileData( const wxString &filePath, const wxString &fileName, file ReadData(); } +void wxFileData::Init() +{ + m_size = 0; + m_type = wxFileData::is_file; + m_image = wxFileIconsTable::file; +} + void wxFileData::Copy( const wxFileData& fileData ) { m_fileName = fileData.GetFileName(); @@ -173,7 +181,7 @@ void wxFileData::Copy( const wxFileData& fileData ) m_dateTime = fileData.GetDateTime(); m_permissions = fileData.GetPermissions(); m_type = fileData.GetType(); - m_image = GetImageId(); + m_image = fileData.GetImageId(); } void wxFileData::ReadData() @@ -507,20 +515,20 @@ void wxFileCtrl::UpdateFiles() #if defined(__WINDOWS__) || defined(__DOS__) || defined(__WXMAC__) || defined(__OS2__) if ( IsTopMostDir(m_dirName) ) - { + { wxArrayString names, paths; wxArrayInt icons; size_t n, count = wxGetAvailableDrives(paths, names, icons); for (n=0; nSetFocus(); - + return true; } @@ -1200,7 +1208,7 @@ void wxGenericFileDialog::HandleAction( const wxString &fn ) { wxString filename( fn ); wxString dir = m_list->GetDir(); - if (filename.IsEmpty()) return; + if (filename.empty()) return; if (filename == wxT(".")) return; // "some/place/" means they want to chdir not try to load "place"