D20152: Scroll to item if it's not visible on keyPress

Tranter Madi noreply at phabricator.kde.org
Mon Apr 8 22:17:10 BST 2019


trmdi added a comment.


  In D20152#446262 <https://phabricator.kde.org/D20152#446262>, @elvisangelaccio wrote:
  
  > In D20152#445778 <https://phabricator.kde.org/D20152#445778>, @trmdi wrote:
  >
  > > In D20152#445537 <https://phabricator.kde.org/D20152#445537>, @elvisangelaccio wrote:
  > >
  > > > We always call `KItemListSelectionManager::setCurrentItem()` before calling `scrollToItem()`, so we should probably do it also here.
  > >
  > >
  > > I don't think it is needed because it was set in the above code block <https://phabricator.kde.org/source/dolphin/browse/master/src/kitemviews/kitemlistcontroller.cpp$432>.
  >
  >
  > Only if `m_selectionManager->currentItem() != index`, but this won't be true when the item is not visible. Which is why you want to move the `scrollToItem()` call outside this if() block in the first place, isn't it?
  
  
  When `m_selectionManager->currentItem() == index`, the `setCurrentItem(index)` will do nothing.
  See https://phabricator.kde.org/source/dolphin/browse/master/src/kitemviews/kitemlistselectionmanager.cpp$51
  
  Before it is not visible, the above `if` block always runs. That function was called once before, we don't need to call it again.

REPOSITORY
  R318 Dolphin

REVISION DETAIL
  https://phabricator.kde.org/D20152

To: trmdi, #dolphin, ngraham, elvisangelaccio
Cc: elvisangelaccio, kfm-devel, alexde, 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/20190408/36e60397/attachment.htm>


More information about the kfm-devel mailing list