diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-03 16:00:38 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-03 16:00:38 +0200 |
| commit | e6ea00dce8c74bf0d48e769734958a741ca46ef9 (patch) | |
| tree | 2b56659912cfa1f284faefa2e04d841e9a51852e /docs/superpowers/specs | |
| parent | ec390fb46e1a36d8406dde487228bbb0f348a20a (diff) | |
| download | qtmaildir-e6ea00dce8c74bf0d48e769734958a741ca46ef9.tar.gz qtmaildir-e6ea00dce8c74bf0d48e769734958a741ca46ef9.zip | |
feat: persist window, splitter and column widths
Resizing the window, the splitter or a thread-list column was undone by
the next launch. State now round-trips through a separate settings file
at ~/.local/state/qtmaildir/uistate.conf, written on close and read at
startup.
The state file is deliberately not the user's config: a base64 geometry
blob does not belong in a hand-edited file, and rewriting that file on
exit would drop its comments and key order, which QSettings does not
preserve.
Two details that are easy to get wrong:
QStandardPaths::StateLocation appends both the organization and the
application name, and both are "qtmaildir" here, so it resolves to
~/.local/state/qtmaildir/qtmaildir. The path is built from
GenericStateLocation instead, matching Config::defaultPath().
Restore runs after buildMenus() rather than at the end of buildUi():
QMainWindow::restoreState() matches toolbars by object name and silently
drops the position of one that does not exist yet.
Every restore is conditional on a non-empty blob, so a missing or
rejected state file leaves the built-in defaults instead of producing a
zero-size window.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'docs/superpowers/specs')
0 files changed, 0 insertions, 0 deletions
