┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kitemlistcontroller.h
diff options
context:
space:
mode:
authorweinan li <[email protected]>2025-11-10 08:38:31 +0000
committerMéven Car <[email protected]>2025-11-10 08:38:31 +0000
commit3858afbfa4f2f60cc33f39a471d36a1e1a3514c7 (patch)
tree5109e8c061e5f298cc1a2f6e254ea462f7f855c3 /src/kitemviews/kitemlistcontroller.h
parent4159b9c7874facc3774b59ed3aa13692bf14bb55 (diff)
dolphin: improve keyboard search behavior for repeated characters
The original keyboard search implementation had a limitation when dealing with files containing repeated characters like 44.txt. When typing 44, it would trigger rapid navigation to the next item starting with 4 instead of matching the full string 44. This patch introduces a smarter search strategy: 1. First attempt full string matching for exact file names 2. If full match fails and user is typing repeating characters, fall back to rapid navigation using either: - Last successful search string (for extended searches like 444 -> 4444) - First character only (original rapid navigation behavior) The changes include: - Modified changeCurrentItem signal to include a found parameter for search result feedback - Added m_lastSuccessfulSearch to track successful searches for better fallback behavior - Used Qt::DirectConnection to ensure synchronous execution for immediate result feedback This provides better user experience when searching for files with repeated characters while maintaining the rapid navigation feature for quick browsing. BUG: 501851
Diffstat (limited to 'src/kitemviews/kitemlistcontroller.h')
-rw-r--r--src/kitemviews/kitemlistcontroller.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/kitemviews/kitemlistcontroller.h b/src/kitemviews/kitemlistcontroller.h
index 48da07206..48a518610 100644
--- a/src/kitemviews/kitemlistcontroller.h
+++ b/src/kitemviews/kitemlistcontroller.h
@@ -233,7 +233,7 @@ private Q_SLOTS:
*/
void slotRubberBandChanged();
- void slotChangeCurrentItem(const QString &text, bool searchFromNextItem);
+ void slotChangeCurrentItem(const QString &text, bool searchFromNextItem, bool *found);
void slotAutoActivationTimeout();