X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/618a5e382af2e469f9cc9d2aa81114403637a4b3..b916f809336755620b010293637b12763f01455d:/src/generic/dirdlgg.cpp diff --git a/src/generic/dirdlgg.cpp b/src/generic/dirdlgg.cpp index b8bab14d3f..454b60cc05 100644 --- a/src/generic/dirdlgg.cpp +++ b/src/generic/dirdlgg.cpp @@ -312,18 +312,21 @@ void wxDirCtrl::OnExpandItem(wxTreeEvent &event) wxBeginBusyCursor(); wxDirItemData *data = (wxDirItemData *)GetItemData(event.GetItem()); - wxASSERT(data); m_paths.Clear(); m_names.Clear(); - wxDir dir(data->m_path); + wxString path = data->m_path; + + wxDir dir(path); + + path += _T('/'); wxString filename; bool cont = dir.GetFirst(&filename, "", wxDIR_DIRS | wxDIR_HIDDEN); while ( cont ) { - m_paths.Add(data->m_path); + m_paths.Add(path + filename); m_names.Add(filename); cont = dir.GetNext(&filename); @@ -443,7 +446,7 @@ wxDirDialog::wxDirDialog(wxWindow *parent, long cookie = 0; // default to root dir wxTreeItemId item = m_dir->GetFirstChild(m_dir->GetRootItem(), cookie); - + if (!m_path.IsEmpty() && (m_path != wxT("/")) && (m_dir->m_paths.Count() > 1)) { size_t count = m_dir->m_paths.GetCount(); @@ -452,14 +455,14 @@ wxDirDialog::wxDirDialog(wxWindow *parent, if (m_path.Find( m_dir->m_paths[i] ) == 0) { path = m_dir->m_paths[i]; - + for (size_t j = 0; j < i; j++) item = m_dir->GetNextChild(m_dir->GetRootItem(), cookie); - + wxStringTokenizer tk2(path, wxFILE_SEP_PATH, wxTOKEN_STRTOK); for (size_t h = 0; h < tk2.CountTokens(); h++) tk.GetNextToken(); - + break; } }