Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: Der Meister on September 19, 2007, 07:31:10 pm

Title: Bug #11979
Post by: Der Meister on September 19, 2007, 07:31:10 pm
I'm just trying to fix this one (https://developer.berlios.de/bugs/?func=detailbug&bug_id=11979&group_id=5358). I already discovered the reason for this bug and the fix is rather trivial: EditorManager::RebuildOpenedFilesTree rebuilds the tree but does not sort it. The fix for it is only adding a call to wxTreeCtrl::SortChildren in this function. Already did this and tested it and it seems to work. I will submit a patch for this later.

However, while searching for the problem I noticed another small issue:
In ProjectManager::EndLoadingProject, which is obviously called after a project was loaded, there are these lines of code:
Code
    #ifdef USE_OPENFILES_TREE
    Manager::Get()->GetEditorManager()->RebuildOpenedFilesTree();
    #endif
This causes a full rebuild of the tree (and therefore it was unsorted after loading a project). But is this really necessary? The tree is already created while all previously open files are opened and it is even sorted. I just removed this line and did a small test - no issue was visible to me. Am I missing something or is this rebuilding really not needed? If it is not needed any more may I add this change to my patch?
Title: Re: Bug #11979
Post by: Der Meister on September 27, 2007, 09:12:38 pm
As there seems to be no protest against this change I submitted the patch on berlios:
https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=2191&group_id=5358
Title: Re: Bug #11979
Post by: mandrav on September 27, 2007, 09:58:56 pm
As there seems to be no protest against this change I submitted the patch on berlios:
https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=2191&group_id=5358

Thanks :).