Created attachment 183096 [details] The new Smart Flat TreeView SUMMARY This is not a classic issue, but rather a question of whether the intended implementation is something usefull. I also considered opening a discussion topic for Kate but couldn't find anything appropriate. A brief background: I use Kate for all kinds of programming, including Java (and as we all know, Java projects tend to have a deep folder structurt, that's how the idea came about). I developed a prototype of a "Smart Flat TreeView" that mimics the behavior seen in Eclipse, IntelliJ, and VSCode. If a folder only contains another single folder, it doesn't need to be shown as a separate leaf in the tree. It can be "flattened" and represented accordingly. Attached is my prototype of the new TreeView. Now the question is: Is this desired or unnecessary? I would add it as an option in the settings, allowing users to choose which TreeView to use. Happy to hear your feedback
Valid request. I would like something like this myself. Relevant code to look at in case someone wants to work on this https://invent.kde.org/utilities/kate/-/blob/master/addons/project/kateprojectworker.cpp?ref_type=heads#L362
(In reply to Waqar Ahmed from comment #1) > Valid request. I would like something like this myself. > > Relevant code to look at in case someone wants to work on this > https://invent.kde.org/utilities/kate/-/blob/master/addons/project/ > kateprojectworker.cpp?ref_type=heads#L362 Thanks for your reply. I started digging into the code base a bit today. My original approach was to replace the QTreeView with my new SmartFileTreeView component, which inherits from QTreeView. But I will take a look at the line of code you suggested. Thanks.
I would love that feature, too! Would be a great option to have and could even be the default if it works well.
I pushed the first version of the flattened algorithm. https://invent.kde.org/mgrave/kate/-/commit/88e82d537e0ebcb12e940096549b5fa6131f0014 The only thing that's missing is the appending of the extracted flattened folder into the correct hierarchy (and I think some case handling). I'm unsure how it works. Maybe someone can help me.
> The only thing that's missing is the appending of the extracted flattened folder into the correct hierarchy (and I think some case handling). I'm unsure how it works What do you mean? Sorry, I don't understand. Can you explain a bit? Appending an item to a folder is done using the appendRow() function. We can discuss/help better if you open an MR.
(In reply to Waqar Ahmed from comment #5) > > The only thing that's missing is the appending of the extracted flattened folder into the correct hierarchy (and I think some case handling). > I'm unsure how it works > > What do you mean? Sorry, I don't understand. Can you explain a bit? > > Appending an item to a folder is done using the appendRow() function. We can > discuss/help better if you open an MR. I open an MR and explained everything there: https://invent.kde.org/utilities/kate/-/merge_requests/1821
This is done now