Bug 389869 - After deletion of selected files current item moves one down
Summary: After deletion of selected files current item moves one down
Status: RESOLVED FIXED
Alias: None
Product: krusader
Classification: Applications
Component: general (show other bugs)
Version: 2.6.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Krusader Bugs Distribution List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-04 12:21 UTC by Peter Mühlenpfordt
Modified: 2018-05-06 00:16 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Panel before/after deletion of selected files (23.80 KB, image/png)
2018-02-04 12:21 UTC, Peter Mühlenpfordt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Mühlenpfordt 2018-02-04 12:21:42 UTC
Created attachment 110331 [details]
Panel before/after deletion of selected files

After deleting one or more selected files and current item is not one of these, the current item is moved one down.

Steps to reproduce:
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

Expected: Current item should stay on "file3"

What happens: Current item is moved down to "file4"

Tested with Krusader v2.6.0 from Kubuntu 17.10 packages and current master from git.
Comment 1 Toni Asensi Esteve 2018-02-04 17:57:58 UTC
Thanks, Peter. 

This didn't happen using Krusader 2.4.0-beta3.
Comment 2 Toni Asensi Esteve 2018-02-08 13:46:43 UTC
Note: This is related to
    https://phabricator.kde.org/D10385
Comment 3 Peter Mühlenpfordt 2018-02-14 06:48:37 UTC
Git commit dc38f3cfc6fd4477231967c03ea7fe76581d4e4c by Peter Mühlenpfordt.
Committed on 14/02/2018 at 06:48.
Pushed by muhlenpfordt into branch 'master'.

Fix setting new current item after file deletion

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.

Test Plan:
1. Create a folder with 5 files "file1".."file5"
2. Select "file1" and "file2"
3. Set current item to "file3"
4. Press {key Del} and delete selected files
-> The current item should stay on "file3"

Reviewers: #krusader, martinkostolny

Reviewed By: #krusader, martinkostolny

Subscribers: martinkostolny, asensi

Differential Revision: https://phabricator.kde.org/D10385

M  +4    -2    krusader/Panel/PanelView/krview.cpp
M  +1    -1    krusader/Panel/PanelView/krview.h
M  +2    -1    krusader/Panel/listpanel.cpp

https://commits.kde.org/krusader/dc38f3cfc6fd4477231967c03ea7fe76581d4e4c