fix: Auto calculate the settings size on serialization (#832)

## Summary

* The constant SETTINGS_CONST was hardcoded and needed to be updated
whenever an additional setting was added
* This is no longer necessary as the settings size will be determined
automatically on settings persistence

## Additional Context

* New settings need to be added (as previously) in saveToFile - that's
it

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? YES

---------

Co-authored-by: Xuan Son Nguyen <son@huggingface.co>
This commit is contained in:
jpirnay
2026-02-16 12:11:26 +01:00
committed by GitHub
parent a616f42cb4
commit 50e6ef9bd8
2 changed files with 78 additions and 34 deletions

View File

@@ -2,6 +2,9 @@
#include <cstdint>
#include <iosfwd>
// Forward declarations
class FsFile;
class CrossPointSettings {
private:
// Private constructor for singleton
@@ -182,6 +185,9 @@ class CrossPointSettings {
}
int getReaderFontId() const;
// If count_only is true, returns the number of settings items that would be written.
uint8_t writeSettings(FsFile& file, bool count_only = false) const;
bool saveToFile() const;
bool loadFromFile();