rakhimov / scram

Probabilistic Risk Analysis Tool (fault tree analysis, event tree analysis, etc.)
https://scram-pra.org
GNU General Public License v3.0
133 stars 54 forks source link

GUI: Fail-safe file save #228

Closed rakhimov closed 6 years ago

rakhimov commented 6 years ago

Upon file save operations, should the program, system, or IO fail for any reason, the Model file should never be left in a partial state or be corrupted.

Note that this does not apply to "exported" files, such as graphics (SVG), print-save (PDF), or report (MEF XML).

Qt provides QSaveFile for this purpose; however, it implies the use of Qt File API -- not C API. The core code works with C API and currently doesn't report C stdio write-function failures.

Moreover, the IO operations are blocking, so there should be some status line messages.