Panel: Do not select .. in a filtered view if there are other entries
ClosedPublic

Authored by palant on Feb 14 2017, 4:34 PM.

Details

Summary

I commonly find myself in this situation when browsing a directory tree: I filter the view to locate a directory, press Right, then filter again to locate another directory and press Right again. Oops - that directory was the only entry, yet Krusader left .. selected so that I'm now back in the parent directory. While one part of the issue here is the visuals on a high-DPI screen, leaving .. selected when filtering just isn't good for the user experience. In particular, Total Commander seems to select the first entry matching the filter.

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.
palant updated this revision to Diff 11342.Feb 14 2017, 4:34 PM
palant retitled this revision from to Panel: Do not select .. in a filtered view if there are other entries.
palant updated this object.
palant edited the test plan for this revision. (Show Details)
palant added a reviewer: Krusader.
martinkostolny accepted this revision.Feb 14 2017, 10:24 PM
martinkostolny added a reviewer: martinkostolny.
martinkostolny added a subscriber: martinkostolny.

Yes, the new behaviour makes definitely more sense. Thanks, Wladimir! :)

This revision is now accepted and ready to land.Feb 14 2017, 10:24 PM
abika added a subscriber: abika.Feb 15 2017, 5:30 PM

I don't want to be pedantic but there is a small misbehavior: when the current item is ".." and "Show hidden files" setting is changed (Alt+".") the current jumps to the first file now. Probably nobody will ever notice but checking against empty _quickFilterMask should also solve it.

palant updated this revision to Diff 11393.Feb 16 2017, 8:11 AM
palant edited edge metadata.

Alex, thank you, I missed that indeed. I thought that isValid() would cover that case already but apparently it doesn't. I updated the patch and everything seems to work correctly now.

palant updated this revision to Diff 11394.Feb 16 2017, 8:13 AM

Previous patch had unrelated changes, removed these now.

Closed by commit R167:de7858ed819e: Panel: Do not select .. in a filtered view if there are other entries (authored by palant, committed by Alexander Bikadorov <alex.bikadorov@kdemail.net>). · Explain WhyFeb 17 2017, 5:36 PM
This revision was automatically updated to reflect the committed changes.
abika added a comment.Feb 17 2017, 5:43 PM

Added a small fix: _count > 0 instead of _count > 1; the dummy file itself is not counted.

[Author and auto-closing was working now with arc]

Too bad, I meant to push this one myself - I have the necessary privileges now :)