do not set project filename on object import (#7973)

This commit is contained in:
Dima Buzdyk 2025-01-08 17:38:25 +06:00 committed by GitHub
parent 7f391bc1af
commit e315586125
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9387,7 +9387,8 @@ void Plater::add_model(bool imperial_units, std::string fname)
if (!load_files(paths, strategy, ask_multi).empty()) { if (!load_files(paths, strategy, ask_multi).empty()) {
if (get_project_name() == _L("Untitled") && paths.size() > 0) { if (get_project_name() == _L("Untitled") && paths.size() > 0) {
p->set_project_filename(wxString::FromUTF8(paths[0].string())); boost::filesystem::path full_path(paths[0].string());
p->set_project_name(from_u8(full_path.stem().string()));
} }
wxGetApp().mainframe->update_title(); wxGetApp().mainframe->update_title();
@ -10997,8 +10998,8 @@ void Plater::add_file()
Plater::TakeSnapshot snapshot(this, snapshot_label); Plater::TakeSnapshot snapshot(this, snapshot_label);
if (!load_files(paths, LoadStrategy::LoadModel, false).empty()) { if (!load_files(paths, LoadStrategy::LoadModel, false).empty()) {
if (get_project_name() == _L("Untitled") && paths.size() > 0) { if (get_project_name() == _L("Untitled") && paths.size() > 0) {
p->set_project_filename(wxString::FromUTF8(paths[0].string())); boost::filesystem::path full_path(paths[0].string());
p->set_project_name(from_u8(full_path.stem().string()));
} }
wxGetApp().mainframe->update_title(); wxGetApp().mainframe->update_title();
} }
@ -11018,7 +11019,8 @@ void Plater::add_file()
Plater::TakeSnapshot snapshot(this, snapshot_label); Plater::TakeSnapshot snapshot(this, snapshot_label);
if (!load_files(paths, LoadStrategy::LoadModel, true).empty()) { if (!load_files(paths, LoadStrategy::LoadModel, true).empty()) {
if (get_project_name() == _L("Untitled") && paths.size() > 0) { if (get_project_name() == _L("Untitled") && paths.size() > 0) {
p->set_project_filename(wxString::FromUTF8(paths[0].string())); boost::filesystem::path full_path(paths[0].string());
p->set_project_name(from_u8(full_path.stem().string()));
} }
wxGetApp().mainframe->update_title(); wxGetApp().mainframe->update_title();
} }