mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
WIP: Merged commits from stable between 1.41.2-beta and 1.42.2 final.
Changes in SupportMaterial.cpp, TriangleMesh.cpp and 01_trianglemesh.t are yet to be merged. WIP: Refactoring of layer height editing. Removed layer_height_ranges from PrintObject, as the Print/PrintObject now hold their copies of Model/ModelObject.
This commit is contained in:
parent
2ed77aadde
commit
52db7b055a
12 changed files with 231 additions and 40 deletions
|
@ -16,6 +16,7 @@
|
|||
#include <boost/property_tree/ini_parser.hpp>
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <boost/format.hpp>
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
|
@ -125,8 +126,13 @@ void AppConfig::load()
|
|||
|
||||
void AppConfig::save()
|
||||
{
|
||||
// The config is first written to a file with a PID suffix and then moved
|
||||
// to avoid race conditions with multiple instances of Slic3r
|
||||
const auto path = config_path();
|
||||
std::string path_pid = (boost::format("%1%.%2%") % path % get_current_pid()).str();
|
||||
|
||||
boost::nowide::ofstream c;
|
||||
c.open(AppConfig::config_path(), std::ios::out | std::ios::trunc);
|
||||
c.open(path_pid, std::ios::out | std::ios::trunc);
|
||||
c << "# " << Slic3r::header_slic3r_generated() << std::endl;
|
||||
// Make sure the "no" category is written first.
|
||||
for (const std::pair<std::string, std::string> &kvp : m_storage[""])
|
||||
|
@ -155,6 +161,8 @@ void AppConfig::save()
|
|||
}
|
||||
}
|
||||
c.close();
|
||||
|
||||
rename_file(path_pid, path);
|
||||
m_dirty = false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue