FIX:open or replace 3MF file case insensitive

jira: STUDIO-7678
Change-Id: I32b34efa053da25edab80ebff1cfe0a414042dd5
(cherry picked from commit fa07ae4d21d3c4cf5286a38f2cc0a35363a5f53a)
This commit is contained in:
zhou.xu 2024-07-24 15:44:55 +08:00 committed by Lane.Wei
parent 70a0f0a447
commit ed81888b6c
1 changed files with 6 additions and 4 deletions

View File

@ -4611,7 +4611,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)) {
@ -10394,7 +10394,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
@ -10471,7 +10471,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;
}
@ -10550,7 +10552,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