Select item from search window
ClosedPublic

Authored by gengisdave on Dec 31 2019, 5:56 PM.

Details

Summary

When you select an item from the search window but the panel has already the same path, the focus switches but the new item is not selected. This patch set the new item in the folder.

FIXED: [ 401433 ] Highlight/autoselect file issue from "Results" tab in search window
BUG: 401433

Test Plan

Select two item in the search window with the same path, every selection must change accordingly the item selected in the panel.

No regression found in normal panel usage, like filtering and so on.

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.
gengisdave requested review of this revision.Dec 31 2019, 5:56 PM
gengisdave created this revision.
asensi accepted this revision as: asensi.Jan 14 2020, 10:00 PM
asensi added a subscriber: asensi.

That bug has been hindering Krusader users for too long, thanks Davide! :-)

I have tested it and the improvements worked under Kubuntu 18.04 LTS and Kubuntu 19.10, other people can do their checks.

This revision is now accepted and ready to land.Jan 14 2020, 10:00 PM

Note: In other words, the proposal solves the cases where people e.g. search for a file, press Return (or double-click) on a result, and sometimes that action leads them to that file, and sometimes it doesn't.

abika accepted this revision as: abika.Jan 27 2020, 4:50 PM
abika added a subscriber: abika.

Thanks for the fix Davide! This was also annoying me a lot.

Although the current fix works for me, i propose to change the added line into

panel->view->setNameToMakeCurrent(nameToMakeCurrent);

because nameToMakeCurrent is the universal way to set the current item after refresh.
And setCurrentItem() does only work if the directory has not changed. Otherwise the call will try to set a file as current which is not is not there yet as the directory hasn't changed yet.
And if you disagree to this, please add at least a comment.

Although the current fix works for me, i propose to change the added line into

panel->view->setNameToMakeCurrent(nameToMakeCurrent);

I agree, will change the commit.

This revision was automatically updated to reflect the committed changes.