Reimplemented wxFileName with m_relative field.
Adapted wxFileDialog to trailing slashes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13038 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -759,6 +759,9 @@ void wxFileCtrl::GoToParentDir()
|
||||
{
|
||||
if (m_dirName != wxT("/"))
|
||||
{
|
||||
size_t len = m_dirName.Len();
|
||||
if (m_dirName[len-1] == wxT('/'))
|
||||
m_dirName.Remove( len-1, 1 );
|
||||
wxString fname( wxFileNameFromPath(m_dirName) );
|
||||
m_dirName = wxPathOnly( m_dirName );
|
||||
if (m_dirName.IsEmpty()) m_dirName = wxT("/");
|
||||
@@ -919,12 +922,17 @@ wxFileDialog::wxFileDialog(wxWindow *parent,
|
||||
m_dialogStyle |= wxOPEN;
|
||||
|
||||
m_dir = defaultDir;
|
||||
if ((m_dir.IsEmpty()) || (m_dir == wxT(".")))
|
||||
if ((m_dir.empty()) || (m_dir == wxT(".")))
|
||||
{
|
||||
char buf[200];
|
||||
m_dir = getcwd( buf, sizeof(buf) );
|
||||
}
|
||||
m_path = defaultDir;
|
||||
|
||||
size_t len = m_dir.Len();
|
||||
if ((len > 1) && (m_dir[len-1] == wxT('/')))
|
||||
m_dir.Remove( len-1, 1 );
|
||||
|
||||
m_path = m_dir;
|
||||
m_path += wxT("/");
|
||||
m_path += defaultFile;
|
||||
m_fileName = defaultFile;
|
||||
|
||||
Reference in New Issue
Block a user