aboutsummaryrefslogtreecommitdiffstats
path: root/src/savequerydialog.cpp
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-24 18:55:38 +0200
committerDanilo M. <danix@danix.xyz>2026-08-24 18:55:38 +0200
commit94462ae2cc68d563f883b29f1812f93d6b5a6c06 (patch)
tree6ed578a77265177fcdaf8e27b35e9bb0b0815369 /src/savequerydialog.cpp
parent8743f4828d8ce31879b56338c284b72757530548 (diff)
downloadqtmaildir-94462ae2cc68d563f883b29f1812f93d6b5a6c06.tar.gz
qtmaildir-94462ae2cc68d563f883b29f1812f93d6b5a6c06.zip
feat(queries): drop pinning, the menu is every saved query's home
Item 94. The query row is the six built-in filters (Unread, Inbox, Important, Sent, Drafts, Trash), which compose with the account dropdown, and every saved query lives in the More queries menu. Nothing has to decide which of the user's queries get button space, which is the question item 93 would otherwise have had to answer. SavedQuery::pinned is gone from the struct, the reader, the writer, the save dialog's checkbox and the pin/unpin context action. The stored key is stripped rather than left ignored, at the user's choice. That has one non-obvious requirement: `pinned` stays named in loadSavedQueries' `known` list precisely so it is NOT collected as an unknown field, since those are preserved and written straight back. A mutation removing that name puts the key in the file for ever. Confirmed with the user before starting that the built-in set covers their use, since removing pinning removes the escape hatch this item was blocked on. Tests: four pinning tests replaced by two on the new rule, four more converted from buttons to menu entries. migrationPinsEveryEntry and aStoredGeneratedQueryIsUnpinnedNotDropped are rewritten around the property that outlived the flag rather than deleted: an entry must be KEPT, which is what both assertions were really guarding. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KEcn3u19xPqv6ggD15PG4c
Diffstat (limited to 'src/savequerydialog.cpp')
-rw-r--r--src/savequerydialog.cpp8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/savequerydialog.cpp b/src/savequerydialog.cpp
index 2d09986..43c226b 100644
--- a/src/savequerydialog.cpp
+++ b/src/savequerydialog.cpp
@@ -18,7 +18,6 @@
#include "savequerydialog.h"
-#include <QCheckBox>
#include <QComboBox>
#include <QDialogButtonBox>
#include <QFormLayout>
@@ -45,7 +44,6 @@ SaveQueryDialog::SaveQueryDialog(const Config &config, const QString &query,
SavedQuery initial;
initial.query = query;
initial.account = accountKey;
- initial.pinned = true;
setWindowTitle(tr("Save query"));
build(initial);
}
@@ -101,11 +99,6 @@ void SaveQueryDialog::build(const SavedQuery &initial)
m_account->setCurrentIndex(index >= 0 ? index : 0);
form->addRow(tr("Account"), m_account);
- m_pinned = new QCheckBox(tr("Show as a button"), this);
- m_pinned->setObjectName(QStringLiteral("saveQueryPinned"));
- m_pinned->setChecked(initial.pinned);
- form->addRow(QString(), m_pinned);
-
layout->addLayout(form);
// Says what is about to happen rather than refusing the name. Overwriting
@@ -162,7 +155,6 @@ SavedQuery SaveQueryDialog::savedQuery() const
saved.name = m_name->text().trimmed();
saved.query = m_query->text().trimmed();
saved.account = m_account->currentData().toString();
- saved.pinned = m_pinned->isChecked();
// Carried through rather than re-derived: an edit must not turn a
// generated entry into a plain one holding a snapshot of what it happened
// to resolve to today.