Skip to content

Reload file

Ole Christian Eidheim requested to merge d3rrial:reload_file into master

Created by: d3rrial

Adds a menu option to reload the current file. Normally when a file is changed from outside of juCi++, it first has to be closed completely and then re-opened in order to work with these changes.

In case of a race while using this PR (a file was changed externally and juCi++ has unsaved changes), upon clicking "Reload File" in the menu, the function will always be executed, but the user is asked if they want to save the current file before it's opened. There's no merging and no backups, either the file on the drive is overwritten or the changes within the editor are overwritten.

To fix this, it would make sense to add an extra warning beforehand, or, instead of an overwriting save, open the "Save File As" prompt, to give the user the option to save his current changes to a separate file and manually merge them afterwards.

I don't know how to do that, so it's not in this pull request.

This pull request addresses this issue I opened earlier: https://github.com/cppit/jucipp/issues/285

I'm going to try to find out how to solve the race-condition, but I'd like your input on that.

Merge request reports