aboutsummaryrefslogtreecommitdiffstats
path: root/src/config.h
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-03 09:28:33 +0200
committerDanilo M. <danix@danix.xyz>2026-08-03 09:28:33 +0200
commit3ee73d48c9d819b2e186655b7ba86ebc2a961baf (patch)
tree1e5b9c45ef7a83c50fe47eba7adf4bde0a5f5c39 /src/config.h
parent633ae0c09a4a3bb1cfdf15b36328d8e2ced55d30 (diff)
downloadqtmaildir-3ee73d48c9d819b2e186655b7ba86ebc2a961baf.tar.gz
qtmaildir-3ee73d48c9d819b2e186655b7ba86ebc2a961baf.zip
fix: only interrupt startup for real configuration problems
Found while walking the task 13 checklist against real mail. Item 1 ("startup shows no configuration warnings with a valid config") failed: with a perfectly valid config that simply had no [sync] command, every launch opened a blocking modal that had to be dismissed before the window could be used. Config now separates the two cases. A problem is something configured but wrong (a sync command that does not exist, an account with no maildir); those still open a dialog, as does every KeyMap warning, since each one means a binding the user wrote is being ignored. A notice is an optional feature simply not being configured; it reports to the status bar only. Nothing is broken in that case, and a modal on every launch teaches the user to dismiss dialogs unread, which defeats the ones that matter. problems() is a subset of warnings(), so callers wanting everything need only the latter. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'src/config.h')
-rw-r--r--src/config.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/config.h b/src/config.h
index f037db5..80f6101 100644
--- a/src/config.h
+++ b/src/config.h
@@ -50,13 +50,29 @@ public:
/// Optional alternate notmuch config file. Empty means "let notmuch decide".
QString notmuchConfig() const { return m_notmuchConfig; }
- /// Non-fatal problems, shown once in a startup banner.
+ /// Every non-fatal problem, both kinds below. Shown in the status bar.
QStringList warnings() const { return m_warnings; }
+ /// The subset worth interrupting startup for: something in the config is
+ /// wrong and the user's stated intent is not being honoured (a malformed
+ /// account, an unparseable key binding, a sync command that does not
+ /// exist). An optional setting simply being absent is NOT one of these:
+ /// nothing is broken, the feature is just off, and a modal on every launch
+ /// trains the user to dismiss dialogs without reading them.
+ QStringList problems() const { return m_problems; }
+
private:
+ /// Records a problem: something configured but wrong. Also appears in
+ /// warnings(), so callers that want everything need only that one.
+ void addProblem(const QString &message);
+
+ /// Records a notice: nothing is wrong, a feature is simply not configured.
+ void addNotice(const QString &message);
+
QList<Account> m_accounts;
QList<SavedQuery> m_savedQueries;
QString m_syncCommand;
QString m_notmuchConfig;
QStringList m_warnings;
+ QStringList m_problems;
};