D23716: When the selection is deselected, restart the keyboard search from the beginning
Méven Car
noreply at phabricator.kde.org
Thu Sep 5 13:47:38 BST 2019
meven added a comment.
In D23716#525602 <https://phabricator.kde.org/D23716#525602>, @ngraham wrote:
> Nice. But I'm wondering why we even need the 1 second timeout for the case where the selection is cleared.
`emit changeCurrentItem` triggers `KItemListController::slotChangeCurrentItem` which calls in a row:
m_selectionManager->clearSelection();
m_selectionManager->setSelected(index, 1);
Triggering `KItemListSelectionManager::SelectionChanged` twice in a row and `KItemListKeyboardSearchManager::slotSelectionChanged` twice
The first time with : previous.isEmpty(): false current.isEmpty(): true previous.count(): 1 current.count(): 0 # deselect everything
Second time with : previous.isEmpty(): true current.isEmpty(): false previous.count(): 0 current.count(): 1 # select the new element
This caused a bug :
Let's you have three files : e1 e2 e3 in folder.
You type e then e and then e you expect the third file to be selected e3.
Without this check, the first file was selected and all subsequent e typing stays on the same file.
I have changed this to not be needed anymore adding `KItemListSelectionManager::replaceSelection`
REPOSITORY
R318 Dolphin
REVISION DETAIL
https://phabricator.kde.org/D23716
To: meven, #dolphin, elvisangelaccio
Cc: ngraham, kfm-devel, iasensio, fprice, MrPepe, fbampaloukas, alexde, Codezela, feverfew, meven, spoorun, navarromorales, firef, andrebarros, emmanuelp, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20190905/5688f42a/attachment.htm>
More information about the kfm-devel
mailing list