Strip path when autofilling filename
This commit is contained in:
parent
1e055b17b2
commit
02965a8adb
1 changed files with 6 additions and 2 deletions
|
@ -562,8 +562,12 @@ void wxeditor_uploaddialog::on_ok(wxCommandEvent& e)
|
|||
std::string fn = tostdstring(filename->GetValue());
|
||||
std::vector<char> content;
|
||||
if(file->GetValue()) {
|
||||
if(fn == "")
|
||||
filename->SetValue(ufilename->GetValue());
|
||||
if(fn == "") {
|
||||
std::string name = tostdstring(ufilename->GetValue());
|
||||
auto r = regex(".*/([^/]+)", name);
|
||||
if(r) name = r[1];
|
||||
filename->SetValue(towxstring(name));
|
||||
}
|
||||
boost::iostreams::back_insert_device<std::vector<char>> rd(content);
|
||||
std::ifstream in(tostdstring(ufilename->GetValue()), std::ios::binary);
|
||||
if(!in) {
|
||||
|
|
Loading…
Add table
Reference in a new issue