From e3155861258205f93048bb9c10c3fae511bd6b15 Mon Sep 17 00:00:00 2001 From: Dima Buzdyk <46728448+buzzhuzz@users.noreply.github.com> Date: Wed, 8 Jan 2025 17:38:25 +0600 Subject: [PATCH] do not set project filename on object import (#7973) --- src/slic3r/GUI/Plater.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index e12f0c321c9..eb017db6958 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -9387,7 +9387,8 @@ void Plater::add_model(bool imperial_units, std::string fname) if (!load_files(paths, strategy, ask_multi).empty()) { 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(); @@ -10997,8 +10998,8 @@ void Plater::add_file() Plater::TakeSnapshot snapshot(this, snapshot_label); if (!load_files(paths, LoadStrategy::LoadModel, false).empty()) { 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(); } @@ -11018,7 +11019,8 @@ void Plater::add_file() Plater::TakeSnapshot snapshot(this, snapshot_label); if (!load_files(paths, LoadStrategy::LoadModel, true).empty()) { 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(); }