Avoid overriding wxDirDialog::GetPath[s]() unnecessarily
Don't duplicate practically the same code in all ports, just add m_paths itself to the base class. The only drawback of doing this is that it's unused in the ports not (yet) using it, but this saves enough code in the aggregate to be worth it.
This commit is contained in:
@@ -151,19 +151,6 @@ void wxDirDialog::SetPath(const wxString& path)
|
||||
}
|
||||
}
|
||||
|
||||
wxString wxDirDialog::GetPath() const
|
||||
{
|
||||
wxCHECK_MSG( !HasFlag(wxDD_MULTIPLE), wxEmptyString,
|
||||
"When using wxDD_MULTIPLE, must call GetPaths() instead" );
|
||||
|
||||
return m_path;
|
||||
}
|
||||
|
||||
void wxDirDialog::GetPaths(wxArrayString& paths) const
|
||||
{
|
||||
paths = m_paths;
|
||||
}
|
||||
|
||||
int wxDirDialog::ShowModal()
|
||||
{
|
||||
WX_HOOK_MODAL_DIALOG();
|
||||
@@ -293,7 +280,7 @@ int wxDirDialog::ShowIFileOpenDialog(WXHWND owner)
|
||||
{
|
||||
if ( !HasFlag(wxDD_MULTIPLE) )
|
||||
{
|
||||
m_path = m_paths.front();
|
||||
m_path = m_paths.Last();
|
||||
}
|
||||
|
||||
return wxID_OK;
|
||||
|
Reference in New Issue
Block a user