Fix compatibility with newer Boost (#7884)

* PrintBase.cpp: fix compatibility with newer Boost

* Plater.cpp: fix compatibility with newer Boost

* RemovableDriveManager.cpp: fix compatibility with newer Boost

* AuxiliaryDataViewModel.cpp: fix compatibility with newer Boost
This commit is contained in:
Arne Keller 2025-01-07 16:25:32 +01:00 committed by GitHub
parent 4e19c305ae
commit a90cc292e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 5 deletions

View file

@ -79,7 +79,7 @@ std::string PrintBase::output_filename(const std::string &format, const std::str
cfg.opt_string("input_filename_base") + default_ext : cfg.opt_string("input_filename_base") + default_ext :
this->placeholder_parser().process(format, 0, &cfg); this->placeholder_parser().process(format, 0, &cfg);
if (filename.extension().empty()) if (filename.extension().empty())
filename = boost::filesystem::change_extension(filename, default_ext); filename.replace_extension(default_ext);
return filename.string(); return filename.string();
} catch (std::runtime_error &err) { } catch (std::runtime_error &err) {
throw Slic3r::PlaceholderParserError(L("Failed processing of the filename_format template.") + "\n" + err.what()); throw Slic3r::PlaceholderParserError(L("Failed processing of the filename_format template.") + "\n" + err.what());

View file

@ -337,7 +337,7 @@ wxDataViewItemArray AuxiliaryModel::ImportFile(AuxiliaryModelNode* sel, wxArrayS
dir_path += "\\" + src_bfs_path.filename().generic_wstring(); dir_path += "\\" + src_bfs_path.filename().generic_wstring();
boost::system::error_code ec; boost::system::error_code ec;
if (!fs::copy_file(src_bfs_path, fs::path(dir_path.ToStdWstring()), fs::copy_option::overwrite_if_exists, ec)) if (!fs::copy_file(src_bfs_path, fs::path(dir_path.ToStdWstring()), fs::copy_options::overwrite_existing, ec))
continue; continue;
// Update model data // Update model data

View file

@ -10265,7 +10265,7 @@ bool Plater::preview_zip_archive(const boost::filesystem::path& archive_path)
std::replace(name.begin(), name.end(), '\\', '/'); std::replace(name.begin(), name.end(), '\\', '/');
// rename if file exists // rename if file exists
std::string filename = path.filename().string(); std::string filename = path.filename().string();
std::string extension = boost::filesystem::extension(path); std::string extension = path.extension().string();
std::string just_filename = filename.substr(0, filename.size() - extension.size()); std::string just_filename = filename.substr(0, filename.size() - extension.size());
std::string final_filename = just_filename; std::string final_filename = just_filename;

View file

@ -22,7 +22,6 @@
#include <pwd.h> #include <pwd.h>
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <boost/system/error_code.hpp> #include <boost/system/error_code.hpp>
#include <boost/filesystem/convenience.hpp>
#include <boost/process.hpp> #include <boost/process.hpp>
#endif #endif
@ -202,7 +201,7 @@ namespace search_for_drives_internal
stat(path.c_str(), &buf); stat(path.c_str(), &buf);
uid_t uid = buf.st_uid; uid_t uid = buf.st_uid;
if (getuid() == uid) if (getuid() == uid)
out.emplace_back(DriveData{ boost::filesystem::basename(boost::filesystem::path(path)), path }); out.emplace_back(DriveData{ boost::filesystem::path(path).stem().string(), path });
} }
} }
} }