mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-18 07:25:53 +08:00
Replace some deprecated boost functions.
Actually, all those deprecated functions were internally called those new functions. So there isn't any risk to use them directly.
This commit is contained in:
parent
2c671d8d6c
commit
611afd9789
@ -78,7 +78,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(_u8L("Failed processing of the output_filename_format template.") + "\n" + err.what());
|
throw Slic3r::PlaceholderParserError(_u8L("Failed processing of the output_filename_format template.") + "\n" + err.what());
|
||||||
|
@ -707,7 +707,7 @@ CopyFileResult copy_file_inner(const std::string& from, const std::string& to, s
|
|||||||
// That may happen when copying on some exotic file system, for example Linux on Chrome.
|
// That may happen when copying on some exotic file system, for example Linux on Chrome.
|
||||||
copy_file_linux(source, target, ec);
|
copy_file_linux(source, target, ec);
|
||||||
#else // __linux__
|
#else // __linux__
|
||||||
boost::filesystem::copy_file(source, target, boost::filesystem::copy_option::overwrite_if_exists, ec);
|
boost::filesystem::copy_file(source, target, boost::filesystem::copy_options::overwrite_existing, ec);
|
||||||
#endif // __linux__
|
#endif // __linux__
|
||||||
if (ec) {
|
if (ec) {
|
||||||
error_message = ec.message();
|
error_message = ec.message();
|
||||||
|
@ -138,7 +138,7 @@ void FileGet::priv::get_perform()
|
|||||||
if (m_written == 0)
|
if (m_written == 0)
|
||||||
{
|
{
|
||||||
boost::filesystem::path dest_path = m_dest_folder / m_filename;
|
boost::filesystem::path dest_path = m_dest_folder / m_filename;
|
||||||
std::string extension = boost::filesystem::extension(dest_path);
|
std::string extension = dest_path.extension().string();
|
||||||
std::string just_filename = m_filename.substr(0, m_filename.size() - extension.size());
|
std::string just_filename = m_filename.substr(0, m_filename.size() - extension.size());
|
||||||
std::string final_filename = just_filename;
|
std::string final_filename = just_filename;
|
||||||
// Find unsed filename
|
// Find unsed filename
|
||||||
|
@ -503,7 +503,7 @@ void GalleryDialog::change_thumbnail()
|
|||||||
png_path.replace_extension("png");
|
png_path.replace_extension("png");
|
||||||
|
|
||||||
fs::path current = fs::path(into_u8(input_files.Item(0)));
|
fs::path current = fs::path(into_u8(input_files.Item(0)));
|
||||||
fs::copy_file(current, png_path, fs::copy_option::overwrite_if_exists);
|
fs::copy_file(current, png_path, fs::copy_options::overwrite_existing);
|
||||||
}
|
}
|
||||||
catch (fs::filesystem_error const& e) {
|
catch (fs::filesystem_error const& e) {
|
||||||
std::cerr << e.what() << '\n';
|
std::cerr << e.what() << '\n';
|
||||||
|
@ -5633,7 +5633,7 @@ void Plater::convert_gcode_to_ascii()
|
|||||||
if (res == EResult::InvalidMagicNumber) {
|
if (res == EResult::InvalidMagicNumber) {
|
||||||
in_file.close();
|
in_file.close();
|
||||||
out_file.close();
|
out_file.close();
|
||||||
boost::filesystem::copy_file(input_path, output_path, boost::filesystem::copy_option::overwrite_if_exists);
|
boost::filesystem::copy_file(input_path, output_path, boost::filesystem::copy_options::overwrite_existing);
|
||||||
}
|
}
|
||||||
else if (res != EResult::Success) {
|
else if (res != EResult::Success) {
|
||||||
MessageDialog msg_dlg(this, _L(std::string(translate_result(res))), _L("Error converting G-code file"), wxICON_INFORMATION | wxOK);
|
MessageDialog msg_dlg(this, _L(std::string(translate_result(res))), _L("Error converting G-code file"), wxICON_INFORMATION | wxOK);
|
||||||
@ -5712,7 +5712,7 @@ void Plater::convert_gcode_to_binary()
|
|||||||
if (res == EResult::AlreadyBinarized) {
|
if (res == EResult::AlreadyBinarized) {
|
||||||
in_file.close();
|
in_file.close();
|
||||||
out_file.close();
|
out_file.close();
|
||||||
boost::filesystem::copy_file(input_path, output_path, boost::filesystem::copy_option::overwrite_if_exists);
|
boost::filesystem::copy_file(input_path, output_path, boost::filesystem::copy_options::overwrite_existing);
|
||||||
}
|
}
|
||||||
else if (res != EResult::Success) {
|
else if (res != EResult::Success) {
|
||||||
MessageDialog msg_dlg(this, _L(std::string(translate_result(res))), _L("Error converting G-code file"), wxICON_INFORMATION | wxOK);
|
MessageDialog msg_dlg(this, _L(std::string(translate_result(res))), _L("Error converting G-code file"), wxICON_INFORMATION | wxOK);
|
||||||
@ -5945,7 +5945,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;
|
||||||
|
|
||||||
|
@ -759,7 +759,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 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user