307 * @param errors Where to write any errors |
307 * @param errors Where to write any errors |
308 * @returns whether it succeeded |
308 * @returns whether it succeeded |
309 */ |
309 */ |
310 bool Model::save(QTextStream &errors) const |
310 bool Model::save(QTextStream &errors) const |
311 { |
311 { |
312 // Write the model first into a temporary file |
|
313 QSaveFile file{this->path()}; |
312 QSaveFile file{this->path()}; |
314 file.setDirectWriteFallback(true); |
313 file.setDirectWriteFallback(true); |
315 if (file.open(QSaveFile::WriteOnly)) |
314 if (file.open(QSaveFile::WriteOnly)) |
316 { |
315 { |
317 QTextStream out{&file}; |
316 QTextStream out{&file}; |