Fix setting new current item after file deletion
ClosedPublic

Authored by muhlenpfordt on Feb 8 2018, 12:25 PM.

Details

Summary

After deleting one or more selected files and current item is not one
of these, the current item is moved one down.
This patch modifies KrView::firstUnmarkedBelowCurrent() to not make
an additional step down in finding the next unselected item.

BUG: 389869

Test Plan
  1. Create a folder with 5 files "file1".."file5"
  2. Select "file1" and "file2"
  3. Set current item to "file3"
  4. Press Del and delete selected files

-> The current item should stay on "file3"

Diff Detail

Repository
R167 Krusader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
muhlenpfordt requested review of this revision.Feb 8 2018, 12:25 PM
muhlenpfordt created this revision.

As far as I found out while comparing code and behaviour to v2.5.0 (where this bug does not appear) KrView::firstUnmarkedBelowCurrent() has always returned the wrong item, but this was never used there. The latest Krusader version updates the current item according to this value.

I'm not that familiar with the Krusader code, so hints/corrections concerning this patch are really welcome. :)

asensi added a subscriber: asensi.Feb 8 2018, 1:47 PM

Note: This is related to

https://bugs.kde.org/show_bug.cgi?id=389869
martinkostolny accepted this revision.Feb 13 2018, 9:47 PM
martinkostolny added a subscriber: martinkostolny.

It looks OK to me. I haven't found any issues when testing your change. Thanks a lot for your code! :)

This revision is now accepted and ready to land.Feb 13 2018, 9:47 PM
This revision was automatically updated to reflect the committed changes.