Bug 410143

Summary: Documents Tree View: folders may collapse after opening new file
Product: [Applications] kate Reporter: magiblot
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 19.04.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Link to video reproducing the issue

Description magiblot 2019-07-23 21:35:47 UTC
Created attachment 121699 [details]
Link to video reproducing the issue

SUMMARY

Under certain circumstances, opening a file may cause existing folders in the documents tree view to collapse.

STEPS TO REPRODUCE
See the attached video.

OBSERVED RESULT
Several folders collapsed automatically.

EXPECTED RESULT
No folders should collapse, at least in the situation shown in the video. The application cannot decide on my behalf which entries of the tree view are still relevant and which aren't.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.16.3
KDE Frameworks Version: 5.60.0
Qt Version: 5.13.0
Kernel Version: 5.2.1-arch1-1-ARCH
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-6200U CPU @ 2.30GHz
Memory: 11,7 GiB of RAM

ADDITIONAL INFORMATION
Thank you very much.
Comment 1 magiblot 2020-11-05 01:00:34 UTC
Still an annoying bug in 20.08.2.
Comment 2 Bug Janitor Service 2022-01-14 17:26:37 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/558
Comment 3 Christoph Cullmann 2022-01-16 17:57:17 UTC
Git commit 94d4c02771dad252c573198555b3c72e3f789f64 by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 16/01/2022 at 17:44.
Pushed by cullmann into branch 'master'.

filetree: Fix folders collapse after opening new file

Don't remove + insert, we loose state that way. Instead move rows and
then recursively expand parents if needed.

M  +20   -1    addons/filetree/katefiletree.cpp
M  +2    -0    addons/filetree/katefiletree.h
M  +40   -22   addons/filetree/katefiletreemodel.cpp
M  +1    -1    addons/filetree/katefiletreemodel.h

https://invent.kde.org/utilities/kate/commit/94d4c02771dad252c573198555b3c72e3f789f64