+ m_dirCtrl->SetFilterIndex(sel);
+
+ // If the filter has changed, the view is out of date, so
+ // collapse the tree.
+ m_dirCtrl->ReCreateTree();
+
+ // Expand and select the previously selected paths
+ for (unsigned int i = 0; i < paths.GetCount(); i++)
+ {
+ m_dirCtrl->ExpandPath(paths.Item(i));
+ }
+ }
+ else
+ {
+ wxString currentPath = m_dirCtrl->GetPath();