summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-03 20:52:17 +0200
committerDanilo M. <danix@danix.xyz>2026-08-04 12:54:15 +0200
commiteb56cf5bb04771244f7bb90eadef165ccc5b9a94 (patch)
tree777323e12ba774abd45f05d4a876729f37cb7e0c /tests
parented5f795869b2f63b8f7e164239e4afcf9f13bb77 (diff)
downloadqtmaildir-eb56cf5bb04771244f7bb90eadef165ccc5b9a94.tar.gz
qtmaildir-eb56cf5bb04771244f7bb90eadef165ccc5b9a94.zip
keymap: register complete_query bound to Ctrl+Space
KeyMap::defaultBindings() is the single source of truth for shortcuts: the menus, the shortcut reference dialog and loadDefaults() all read it, so registering here makes the binding appear in the reference and stay rebindable from [keys] without any of them disagreeing. Ctrl+Space is a modifier plus a named key, so it sidesteps the bare capital trap in normalizeSequence() and needs no Shift on any layout. Verified it parses to a single non-empty combination that round-trips to "Ctrl+Space", and it collides with no existing default. Note test_mainwindow now fails its everyKnownActionIsRegistered() assertion: MainWindow does not yet implement complete_query. That wiring is a separate task, and the assertion firing is the intended signal.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_keymap.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_keymap.cpp b/tests/test_keymap.cpp
index 0fb4f57..8f6a6af 100644
--- a/tests/test_keymap.cpp
+++ b/tests/test_keymap.cpp
@@ -37,8 +37,16 @@ private slots:
void defaultsDoNotCollide();
void everyDefaultIsAKnownAction();
void everyDefaultParses();
+ void completeQueryIsBoundByDefault();
};
+void TestKeyMap::completeQueryIsBoundByDefault()
+{
+ QVERIFY(KeyMap::knownActions().contains(QStringLiteral("complete_query")));
+ QCOMPARE(KeyMap::defaultSequenceFor(QStringLiteral("complete_query")),
+ QKeySequence(QStringLiteral("Ctrl+Space")));
+}
+
void TestKeyMap::everyDefaultParses()
{
// A default that does not parse is a dead binding, the failure mode