_path = p;
if (!_path.IsEmpty ()) {
- _file->SetLabel (std_to_wx (filesystem::path (wx_to_std (_path)).leaf().string()));
+ _file->SetLabel(std_to_wx(filesystem::path(wx_to_std(_path)).filename().string()));
} else {
_file->SetLabel (_("(None)"));
}
if (_warn_overwrite) {
style |= wxFD_OVERWRITE_PROMPT;
}
- wxFileDialog* d = new wxFileDialog (this, _prompt, wxEmptyString, wxEmptyString, _wildcard, style);
- d->SetPath (_path);
- if (d->ShowModal () == wxID_OK) {
- SetPath (d->GetPath ());
+ wxFileDialog dialog(this, _prompt, wxEmptyString, wxEmptyString, _wildcard, style);
+ dialog.SetPath(_path);
+ if (dialog.ShowModal() == wxID_OK) {
+ SetPath(dialog.GetPath());
}
- d->Destroy ();
}
void