D9711: Fix renamed file reclaims focus

Elvis Angelaccio noreply at phabricator.kde.org
Sat Jan 20 19:30:36 GMT 2018


elvisangelaccio requested changes to this revision.
elvisangelaccio added a comment.
This revision now requires changes to proceed.


  In https://phabricator.kde.org/D9711#188459, @akrutzler wrote:
  
  > In https://phabricator.kde.org/D9711#187679, @emateli wrote:
  >
  > > Unfortunately I do not have as much time as I would like to investigate this, however I suspect it may have to do with `slotRenamingFinished` and `forceUrlsSelection`. As in the slot is emitted after the files(s) have finished renaming but at that point the user has already changed the selection. If that's the case it may make a bit more sense to handle this inside the `forceUrlSelection` method instead.
  >
  >
  > Hm I could not find a way to solve this inside the `forceUrlSelection` method. But maybe I am missing something.
  
  
  I had a look and this bug is caused by the `forceUrlsSelection()` call in `slotRoleEditingFinished()` (added by https://phabricator.kde.org/R318:478f404b8abf924a0e3e21bbf1dd49aefbe47672).
  The problem is that we are marking the item being renamed as the `m_currentItemUrl`, but that is not necessarily correct as this bug shows.
  
  @emateli is right that `forceUrlsSelection()` is a better place to put this check in. Adding
  
    if (m_container->controller()->selectionManager()->hasSelection()) {
        return;
    }
  
  at the beginning of the method fixes the bug for me.

REPOSITORY
  R318 Dolphin

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

To: akrutzler, ngraham, michaelh, #dolphin, elvisangelaccio
Cc: emateli, elvisangelaccio, #dolphin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20180120/dae7c4d2/attachment.htm>


More information about the kfm-devel mailing list