mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-30 14:22:07 +00:00
skip .stl/.png file when copying system profiles
This commit is contained in:
@@ -654,7 +654,7 @@ inline std::string filter_characters(const std::string& str, const std::string&
|
||||
return filteredStr;
|
||||
}
|
||||
|
||||
void copy_directory_recursively(const boost::filesystem::path &source, const boost::filesystem::path &target);
|
||||
void copy_directory_recursively(const boost::filesystem::path &source, const boost::filesystem::path &target, std::function<bool(const std::string)> filter = nullptr);
|
||||
|
||||
// Orca: Since 1.7.9 Boost deprecated save_string_file and load_string_file, copy and modified from boost 1.7.8
|
||||
void save_string_file(const boost::filesystem::path& p, const std::string& str);
|
||||
|
||||
@@ -1509,7 +1509,7 @@ bool bbl_calc_md5(std::string &filename, std::string &md5_out)
|
||||
}
|
||||
|
||||
// SoftFever: copy directory recursively
|
||||
void copy_directory_recursively(const boost::filesystem::path &source, const boost::filesystem::path &target)
|
||||
void copy_directory_recursively(const boost::filesystem::path &source, const boost::filesystem::path &target, std::function<bool(const std::string)> filter)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << Slic3r::format("copy_directory_recursively %1% -> %2%", source, target);
|
||||
std::string error_message;
|
||||
@@ -1528,6 +1528,8 @@ void copy_directory_recursively(const boost::filesystem::path &source, const boo
|
||||
copy_directory_recursively(dir_entry, target_path);
|
||||
}
|
||||
else {
|
||||
if(filter && filter(name))
|
||||
continue;
|
||||
CopyFileResult cfr = copy_file(source_file, target_file, error_message, false);
|
||||
if (cfr != CopyFileResult::SUCCESS) {
|
||||
BOOST_LOG_TRIVIAL(error) << "Copying failed(" << cfr << "): " << error_message;
|
||||
|
||||
Reference in New Issue
Block a user