FIX:open or replace 3MF file case insensitive (#6802)

jira: STUDIO-7678
Change-Id: I32b34efa053da25edab80ebff1cfe0a414042dd5
(cherry picked from commit fa07ae4d21d3c4cf5286a38f2cc0a35363a5f53a)

Co-authored-by: zhou.xu <zhou.xu@bambulab.com>
This commit is contained in:
Noisyfox 2024-09-19 00:03:57 +08:00 committed by GitHub
parent 47965b02d3
commit 8b8c0cad2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4765,7 +4765,7 @@ wxString Plater::priv::get_export_file(GUI::FileType file_type)
wxString out_path = dlg.GetPath();
fs::path path(into_path(out_path));
#ifdef __WXMSW__
if (path.extension() != output_file.extension()) {
if (boost::iequals(path.extension().string(), output_file.extension().string()) == false) {
out_path += output_file.extension().string();
boost::system::error_code ec;
if (boost::filesystem::exists(into_u8(out_path), ec)) {
@ -10858,7 +10858,7 @@ bool Plater::load_files(const wxArrayString& filenames)
case LoadFilesType::Multiple3MFOther:
for (const auto &path : normal_paths) {
if (wxString(encode_path(path.filename().string().c_str())).EndsWith("3mf")) {
if (boost::iends_with(path.filename().string(), ".3mf")){
if (first_file.size() <= 0)
first_file.push_back(path);
else
@ -10938,7 +10938,9 @@ int Plater::get_3mf_file_count(std::vector<fs::path> paths)
{
auto count = 0;
for (const auto &path : paths) {
if (wxString(encode_path(path.filename().string().c_str())).EndsWith("3mf")) count++;
if (boost::iends_with(path.filename().string(), ".3mf")) {
count++;
}
}
return count;
}
@ -11017,7 +11019,7 @@ void Plater::add_file()
}
case LoadFilesType::Multiple3MFOther:
for (const auto &path : paths) {
if (wxString(encode_path(path.filename().string().c_str())).EndsWith("3mf")) {
if (boost::iends_with(path.filename().string(), ".3mf")) {
if (first_file.size() <= 0)
first_file.push_back(path);
else