Author Topic: Fixed project tree broken sort  (Read 494 times)

Offline Hazanko

  • Single posting newcomer
  • *
  • Posts: 1
Fixed project tree broken sort
« on: February 28, 2026, 02:49:01 am »
Project tree does not properly sort alpha when number of parents reaches a certain count(?). I'm assuming this has something to do with wx reallocating for more space and breaking the tree structure.
This is not an issue on my other machine with codeblocks 20.03/wxgtk3.05 handles sorting properly, as well as on windows(20.03,nightly,25.03).

Included checks for directories vs dirs & directories vs files in cbTreeCtrl::OnCompareItems(...).
Removed call to ProjectFindNodeToInsertAfter(...) in ProjectAddTreeNode(...) as sorting will be entirely handled by sorting children, as well as adding item as first child as we don't care about order at this point.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6177
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Fixed project tree broken sort
« Reply #1 on: February 28, 2026, 03:26:31 am »
Thanks, I'm not familiar with this part of the code. Other devs may have a try.  :)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.