aboutsummaryrefslogtreecommitdiffstats
path: root/src/mainwindow.h
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-08 11:17:29 +0200
committerDanilo M. <danix@danix.xyz>2026-09-08 11:17:29 +0200
commitcaa34f1f4616b6c3e7a11295e7b07fe303b183fb (patch)
treeb03f10b8fa60ee1a0683d9c1896dfb3ddef25d2d /src/mainwindow.h
parenta00d35452fcef8c8bc723ba7045fcae38fe8f315 (diff)
downloadqtmaildir-caa34f1f4616b6c3e7a11295e7b07fe303b183fb.tar.gz
qtmaildir-caa34f1f4616b6c3e7a11295e7b07fe303b183fb.zip
feat: make Sync follow the account being looked at
Item 101. The sync run was already account-aware for pending edits and consulted the account dropdown for nothing, so looking at one account and pressing Sync collected every one of them. pendingSyncChannels() now reads the dropdown as well as m_editedAccounts. The two are a UNION rather than one replacing the other, which is the whole safety property: looking at one account while having edited another is ordinary, and a run that dropped the edited account's channel would strand that write with nothing on screen to say so. All accounts is the empty key and narrows nothing, so a full fetch stays what an unselected window asks for. The existing fallback is untouched: an account whose section names no channel still widens the run rather than being silently skipped. syncStartedText() is the visibility half. A run opened with "Syncing..." whether it covered one account or all of them; it now names what it covers. The exit paths overwrite the label with their own wording immediately, so the parameter is defaulted rather than threaded through them. Four tests. The narrowing one asserts the channel list is EMPTY before the gesture, since empty is what a full fetch looks like and a test starting from a narrowed state could not tell the fix from a window that had never widened. Mutation-checked twice: ignoring the selection fails three of them, and replacing the pending set instead of unioning with it fails the union test alone, which is the version that looks correct and loses a write. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KphFXTc2QajxXsHWyvGJ4R
Diffstat (limited to 'src/mainwindow.h')
-rw-r--r--src/mainwindow.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 3829ae2..55d67ae 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -1012,7 +1012,14 @@ private:
/// the script's output is unstructured, so a bar that filled from left to
/// right would be inventing a fraction nobody knows. An indeterminate one
/// says "working, duration unknown", which is the truth.
- void setSyncBusy(bool busy);
+ /// \p channels is the list the run was started with, used only for the
+ /// opening status line: empty means every account. Defaulted because the
+ /// exit paths overwrite the label with their own wording immediately after.
+ void setSyncBusy(bool busy, const QStringList &channels = {});
+
+ /// The opening status line for a run over \p channels. Item 101's
+ /// visibility half: a narrowed run must say so.
+ Q_INVOKABLE QString syncStartedText(const QStringList &channels) const;
/// Reassembles lines from a sync output chunk and updates the status label
/// when the phase or its detail changes.