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:
parent
47965b02d3
commit
8b8c0cad2a
1 changed files with 6 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue