diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-17 19:51:27 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-17 19:51:27 +0200 |
| commit | 9899b9af523ad2aef55300c9132d21a687a0a19d (patch) | |
| tree | 267cb755844190c1bd6fd0714930950bd8ccf93d /src | |
| parent | acec616bee1c7a336a9dcee8338849b970c3eab1 (diff) | |
| download | qtmaildir-9899b9af523ad2aef55300c9132d21a687a0a19d.tar.gz qtmaildir-9899b9af523ad2aef55300c9132d21a687a0a19d.zip | |
feat(config): warn when an account configures no trash folder
The trash key is mandatory: Delete moves a file into it, so an
account without one cannot delete at all. Report it as a config
problem naming the account and the key, rather than degrading
Delete silently, per the existing "a warning the user cannot act on
teaches them to ignore warnings" rule (item 83).
Several existing test fixtures loaded accounts with no trash key and
asserted zero problems/warnings; added trash=Trash to those where it
was incidental to what the test actually covers.
Diffstat (limited to 'src')
| -rw-r--r-- | src/config.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/config.cpp b/src/config.cpp index d56099a..8294e4b 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -473,6 +473,21 @@ void Config::load(const QString &path) .arg(account.key)); continue; } + + // Mandatory, unlike sent: Delete moves a file into this folder, so an + // account without one cannot delete at all. Reported rather than + // silently disabled, so the user finds out from a warning rather than + // from a Delete that quietly does nothing. The account still loads; + // only Delete is unusable, which does not warrant losing the rest of + // the account's mail. + if (account.trash.isEmpty()) { + addProblem( + tr("Account '%1' has no trash folder configured; add a " + "'trash' key to its section. Delete will not work for " + "this account until it does.") + .arg(account.key)); + } + m_accounts.append(account); } |
