GUI: Fix usage of dummy autosave in empty autosave slot #5363
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR seeks to clean up a few anomalies related to setting up an empty autosave slot in the Save dialog.
The dummy autosave exists to write protect an otherwise empty autosave slot, and as a bonus, also identifies the autosave slot. This is achieved by accessing the dummy autosave settings stored in the _saveList array.
Currently, this approach is only applied when setting the Save button in List View.
Other aspects of an empty autosave slot, such as the Delete button (List View) and the autosave button (Grid View), are currently set up using a less consistent approach.
This results in most engines displaying these anomalies in the Save dialog:
We fix these issues by redirecting the relevant calls for getWriteProtectedFlag(), getDeletableFlag() and getDescription() to target the correct dummy autosave settings stored in the _saveList array.
Since the changes are minimal, I’ve included them all in a single commit.
Edit: I failed to define the isWriteProtected variable type initially, then reverted that change to match how it's initialized and used in updateSelection().
Unfortunately, I'm unable to squash these extra commits into the original commit without closing this PR and starting over, so, if necessary, please do so on my behalf. Thanks..