src/model.cpp

changeset 146
235941b7322f
parent 145
4dea24d3eda0
child 147
37f936073cac
equal deleted inserted replaced
145:4dea24d3eda0 146:235941b7322f
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};

mercurial