X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7e4fb3b8168f4f2dbf2f8a246d3e094a8ccba194..8d79ccefda4259a5c973a86ef5c617580bba20dc:/src/generic/filedlgg.cpp diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp index 638c1173f1..83a751a5bb 100644 --- a/src/generic/filedlgg.cpp +++ b/src/generic/filedlgg.cpp @@ -135,17 +135,10 @@ int wxCALLBACK wxFileDataTimeCompare( long data1, long data2, long data) return fd1->GetDateTime().IsLaterThan(fd2->GetDateTime()) ? int(data) : -int(data); } -#if defined(__UNIX__) && !defined(__OS2__) -#define IsTopMostDir(dir) (dir == wxT("/")) -#endif - #if defined(__DOS__) || defined(__WINDOWS__) || defined (__OS2__) #define IsTopMostDir(dir) (dir.empty()) -#endif - -#if defined(__DOS__) || defined(__WINDOWS__) || defined(__OS2__) -// defined in src/generic/dirctrlg.cpp -extern bool wxIsDriveAvailable(const wxString& dirName); +#else +#define IsTopMostDir(dir) (dir == wxT("/")) #endif // defined in src/generic/dirctrlg.cpp @@ -268,7 +261,7 @@ wxString wxFileData::GetFileType() const return _(""); else if (IsDrive()) return _(""); - else if (m_fileName.Find(wxT('.'), true) != wxNOT_FOUND) + else if (m_fileName.Find(wxT('.'), true) != wxNOT_FOUND) return m_fileName.AfterLast(wxT('.')); return wxEmptyString; @@ -325,7 +318,7 @@ wxString wxFileData::GetEntry( fileListFieldType num ) const break; case FileList_Time: - if (!IsDrive()) + if (!IsDrive()) s = GetModificationTime(); break; @@ -541,7 +534,7 @@ void wxFileCtrl::UpdateFiles() #endif // __UNIX__ wxFileData *fd = new wxFileData(p, wxT(".."), wxFileData::is_dir, wxFileIconsTable::folder); if (Add(fd, item) != -1) - item.m_itemId++; + item.m_itemId++; else delete fd; } @@ -570,7 +563,7 @@ void wxFileCtrl::UpdateFiles() { wxFileData *fd = new wxFileData(dirPrefix + f, f, wxFileData::is_dir, wxFileIconsTable::folder); if (Add(fd, item) != -1) - item.m_itemId++; + item.m_itemId++; else delete fd; @@ -588,7 +581,7 @@ void wxFileCtrl::UpdateFiles() { wxFileData *fd = new wxFileData(dirPrefix + f, f, wxFileData::is_file, wxFileIconsTable::file); if (Add(fd, item) != -1) - item.m_itemId++; + item.m_itemId++; else delete fd; @@ -855,7 +848,6 @@ wxFileCtrl::~wxFileCtrl() #define ID_CHOICE (wxID_FILEDLGG + 8) #define ID_TEXT (wxID_FILEDLGG + 9) #define ID_LIST_CTRL (wxID_FILEDLGG + 10) -#define ID_ACTIVATED (wxID_FILEDLGG + 11) #define ID_CHECK (wxID_FILEDLGG + 12) IMPLEMENT_DYNAMIC_CLASS(wxGenericFileDialog, wxFileDialogBase) @@ -1267,16 +1259,19 @@ void wxGenericFileDialog::HandleAction( const wxString &fn ) } #endif // __UNIX__ - if ((filename.Find(wxT('*')) != wxNOT_FOUND) || - (filename.Find(wxT('?')) != wxNOT_FOUND)) + if (!(m_dialogStyle & wxSAVE)) { - if (filename.Find(wxFILE_SEP_PATH) != wxNOT_FOUND) + if ((filename.Find(wxT('*')) != wxNOT_FOUND) || + (filename.Find(wxT('?')) != wxNOT_FOUND)) { - wxMessageBox(_("Illegal file specification."), _("Error"), wxOK | wxICON_ERROR ); + if (filename.Find(wxFILE_SEP_PATH) != wxNOT_FOUND) + { + wxMessageBox(_("Illegal file specification."), _("Error"), wxOK | wxICON_ERROR ); + return; + } + m_list->SetWild( filename ); return; } - m_list->SetWild( filename ); - return; } if (!IsTopMostDir(dir))