Skip to content

feat(core): allow to disable or reset preferences programmatically

Description

These changes add a new method SPreferences::ignoreFilesystem, which allows to create an empty preferences on startup, ignoring any existing preferences file, and then to not save the preferences on exit. While SPreferences::set_enabled exists, it isn't easily usable as most applications use SPreferences and won't work anymore. SPreferences::ignoreFilesystem(true) is used in GUI tests to improve the reproducibility of the tests and to avoid modifying the preference of the user.

In addition, a case of "infinite" loop when SightCalibrator is used with the preferences disabled is fixed.

Closes #1020 (closed)

How to test it?

Run SightViewer in fullscreen, then close it. Run sightviewerguitest, it shouldn't run in fullscreen. Run SightViewer, it should still be in fullscreen.

Merge request reports