aboutsummaryrefslogtreecommitdiffstats
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-31 12:21:39 +0100
committerDanilo M. <danix@danix.xyz>2026-10-31 12:21:46 +0100
commitaa5fc733c768f8779af897c0cdcaf836b2afcefb (patch)
tree34ec1d186839c12a7288ad99c1f22f25b43b9d6f /src/mainwindow.cpp
parenta30b4c2f2c0b11b7484ae91574755deb5b9a5be9 (diff)
downloadqtmaildir-aa5fc733c768f8779af897c0cdcaf836b2afcefb.tar.gz
qtmaildir-aa5fc733c768f8779af897c0cdcaf836b2afcefb.zip
Revert "fix: credit a tag confirmation to the command whose tags it names"
This reverts commit a30b4c2. A backfill will stop arming commands on the shared confirmation queue altogether, so matching confirmations by tags is no longer needed, and its drop-ahead rule could discard a live command when an unarmed write's tags matched a later one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp32
1 files changed, 3 insertions, 29 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 9b1b874..8b1c537 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -2889,23 +2889,6 @@ void MainWindow::applyRuleToExistingMail(const TagRule &rule)
Q_ARG(quint64, m_pendingApplyGeneration));
}
-QList<const TagCommand *> MainWindow::armTagCommandsForTesting(
- const QList<QPair<QStringList, QStringList>> &ops)
-{
- QList<const TagCommand *> commands;
- m_undoStack.beginMacro(QStringLiteral("test"));
- for (int i = 0; i < ops.size(); ++i) {
- auto *command = new MessageTagCommand(this, {}, ops.at(i).first,
- ops.at(i).second,
- QStringLiteral("test"));
- awaitTagConfirmation(command, i == 0);
- m_undoStack.push(command);
- commands.append(command);
- }
- m_undoStack.endMacro();
- return commands;
-}
-
void MainWindow::confirmRuleApply(const QVector<int> &counts)
{
const TagRule rule = m_pendingApplyRule;
@@ -5322,18 +5305,9 @@ void MainWindow::onTagsApplied(const TagChange &change)
// instead turned the undo of "mark 44 read" into "mark 44 unread": 2
// unread became 43, on real mail, and maildir.synchronize_flags carried it
// into the filenames.
- //
- // Matched on the tags, and the commands ahead of the match dropped: they
- // were writes the worker found nothing to do for, and crediting them this
- // write's ids would make their undo invert the wrong tag on the wrong
- // messages. See awaitTagConfirmation().
- for (int i = 0; i < m_awaitingTagConfirmation.size(); ++i) {
- TagCommand *command = m_awaitingTagConfirmation.at(i);
- if (command->confirmedBy(change)) {
- m_awaitingTagConfirmation.remove(0, i + 1);
- command->addChangedMessageIds(change.messageIds);
- break;
- }
+ if (!m_awaitingTagConfirmation.isEmpty()) {
+ TagCommand *command = m_awaitingTagConfirmation.takeFirst();
+ command->addChangedMessageIds(change.messageIds);
}
// Recorded here, where a write is CONFIRMED, rather than where one is sent: