@@ -44,11 +44,28 @@ void RootViewHost::beforeActionExecuted(const AbstractAction *action) {
4444 if (auto item = m_model->selectedRootItem ()) { manager->registerVisit (item->uniqueId ()); }
4545}
4646
47+ bool RootViewHost::tryAliasFastTrack () {
48+ const auto manager = context ()->services ->rootItemManager ();
49+ const auto item = m_model->selectedRootItem ();
50+
51+ if (!item || !item->supportsAliasSpaceShortcut ()) return false ;
52+
53+ const auto query = context ()->navigation ->searchText (this ).toStdString ();
54+ const auto meta = manager->itemMetadata (item->uniqueId ());
55+
56+ if (!meta.alias || !meta.alias ->starts_with (query)) return false ;
57+
58+ m_model->activateSelected ();
59+ return true ;
60+ }
61+
4762bool RootViewHost::inputFilter (QKeyEvent *event) {
4863 auto manager = context ()->services ->rootItemManager ();
4964 auto &nav = context ()->navigation ;
5065 auto &cfg = context ()->services ->config ()->value ();
5166
67+ if (!event->modifiers () && event->key () == Qt::Key_Space) { return tryAliasFastTrack (); }
68+
5269 // wrapped navigation is incompatible with overriding key up, so we disable history in that case
5370 const bool activatableHistory =
5471 !cfg.wrapNavigation && m_model->selectedIndex () == m_model->nextSelectableIndex (-1 , 1 );
@@ -100,8 +117,3 @@ void RootViewHost::beforePop() {
100117}
101118
102119QObject *RootViewHost::listModel () const { return m_model; }
103-
104- bool RootViewHost::tryAliasFastTrack () {
105- if (!m_model) return false ;
106- return m_model->tryAliasFastTrack ();
107- }
0 commit comments