mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-28 03:11:47 +00:00
Keep the Config Dirty After a Failed Write and Sweep a Write's Own Leftovers
Before this change a config whose temporary could not be written stayed dirty, so the idle handler tried again; the last round cleared the flag regardless, which lost a pending change to a transient failure. The writer reports whether the config itself was written and the flag clears only then, as it always did. The Windows rename retry duplicated what WindowsSupport::rename already does, retrying and moving an open destination aside, and multiplied its error logging; it is gone. The file a refused rename moves aside is named so the sweep can clear it after a crash in between, and every successful atomic write sweeps leftovers of earlier writes to the same target, so the caches and the smaller state files are covered too; the name shapes are strict enough that nothing of the user's matches. The lock wait defaults to a second, long against a critical section of milliseconds and short against the GUI thread; a lock file that cannot be opened says to check its owner and permissions; the test timing bounds tolerate a loaded runner; and the helper's header includes what its declarations use.
This commit is contained in:
@@ -451,9 +451,10 @@ private:
|
||||
|
||||
// Preset for each machine
|
||||
MachineSettingMap m_printer_settings;
|
||||
// Writes the assembled config text, and on Windows its checksum and a backup copy. `checksum_source`
|
||||
// Writes the assembled config text, and on Windows its checksum and a backup copy; false when the
|
||||
// config itself could not be written, in which case the caller stays dirty and retries. `checksum_source`
|
||||
// is the text load() will verify, which for the JSON config ends before the trailing newline.
|
||||
void write_config_file(const std::string &path, std::string body, const std::string &checksum_source);
|
||||
bool write_config_file(const std::string &path, std::string body, const std::string &checksum_source);
|
||||
|
||||
bool m_dirty;
|
||||
// Original version found in the ini file before it was overwritten
|
||||
|
||||
Reference in New Issue
Block a user