QtPass 2.0.0
Developer documentation
Loading...
Searching...
No Matches
SettingsSerializer Class Reference

Maps AppSettings to and from a QSettings store. More...

#include <settingsserializer.h>

Static Public Member Functions

static auto load (QSettings &qs) -> AppSettings
 Read all flat settings from a QSettings store.
static auto loadPasswordConfiguration (QSettings &qs) -> PasswordConfiguration
 Read only the password generation settings from a QSettings store.
static void save (QSettings &qs, const AppSettings &settings)
 Write all flat settings to a QSettings store.

Detailed Description

Maps AppSettings to and from a QSettings store.

Pure, side-effect-free translation between the flat AppSettings value object and the on-disk QSettings keys (the same keys QtPassSettings uses). Unlike the legacy getters it performs no path normalisation, directory creation, screen-centring or .git auto-detection — it only reads and writes raw values. That makes it unit-testable against a throwaway QSettings without any singleton or widget setup.

Definition at line 27 of file settingsserializer.h.

Member Function Documentation

◆ load()

auto SettingsSerializer::load ( QSettings & qs) -> AppSettings
static

Read all flat settings from a QSettings store.

Parameters
qsSource settings store.
Returns
Populated AppSettings (defaults applied for absent keys).

Definition at line 44 of file settingsserializer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadPasswordConfiguration()

auto SettingsSerializer::loadPasswordConfiguration ( QSettings & qs) -> PasswordConfiguration
static

Read only the password generation settings from a QSettings store.

The stored charset selection is validated against PasswordConfiguration::CharacterSet; an out-of-range value (hand-edited or corrupted ini) falls back to ALLCHARS so consumers can index PasswordConfiguration::Characters with it safely.

Parameters
qsSource settings store.
Returns
Populated PasswordConfiguration (defaults applied for absent or invalid keys).

Definition at line 15 of file settingsserializer.cpp.

Here is the caller graph for this function:

◆ save()

void SettingsSerializer::save ( QSettings & qs,
const AppSettings & settings )
static

Write all flat settings to a QSettings store.

Parameters
qsDestination settings store.
settingsValues to persist.

Definition at line 149 of file settingsserializer.cpp.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: