Created attachment 122636 [details]
Picture of issue
Filter bar does not clear last result IF you have a folder expanded
STEPS TO REPRODUCE
1. bring up a directory list then use filter to constrain to an entry
2. expand the directory entry
3. clear the filter term then do another search to constrain to an entry
4. the original 'opened' folder remains in the view
(available in About System)
KDE Plasma Version:
KDE Frameworks Version:
Happens to me on current version. I'm updating the version and changing to CONFIRMED.
You can actually reproduce it by simply expanding some folder before filtering, then filter by some nonsense string "asdasdasd" than should yield zero results, but the folder you expanded will show as a result.
I found the bug: void KFileItemModel::applyFilters() in the file src/kitemviews/kfileitemmodel.cpp. The algorithm creates the bug on purpose, but it doesn't have to.
I'll try to fix it over the weekend. Assigning to myself.
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/271
Git commit ed83f37f06bd5c4b38c100503c3ad4dec2a87912 by Méven Car, on behalf of Eduardo Cruz.
Committed on 04/10/2021 at 07:13.
Pushed by meven into branch 'master'.
Rewrite filter algorithm to properly support filtering with expanded folders under Detail View mode.
Related: bug 442275
M +63 -21 src/kitemviews/kfileitemmodel.cpp
M +26 -12 src/tests/kfileitemmodeltest.cpp