User forums > Using Code::Blocks

Files order in virtual folders

<< < (4/6) > >>

oBFusCATed:
Please post a real patch.  8)

earlgrey:
Not for the moment, I am working on
- my externel lexer loader for scintilla ( which works but will never be accepted by Neil )
- my enhanced OpenFilesList plugin

http://www.mediafire.com/view/qawkuoi05ac8qvu/2015.08.20-cb%20LexerExt%20OFL.png#

earlgrey:
trunk@svn10640 - ProjectTreeSortChildrenRecursive()@ProjectManagerUI.cpp : remove the red part and it is ok

static void ProjectTreeSortChildrenRecursive(cbTreeCtrl* tree, const wxTreeItemId& parent)
{
    wxTreeItemIdValue cookie = nullptr;

    tree->SortChildren(parent);

    wxTreeItemId current = tree->GetFirstChild(parent, cookie);
    while (current && tree->ItemHasChildren(current))
    {
        ProjectTreeSortChildrenRecursive(tree, current);
        current = tree->GetNextChild(parent, cookie);
    }
}

It breaks the recursion traveling ; current may not have children, but may have brothers :

while (...) loop :

                                  current ( = first child )
                                      |
                   +------------------------------------+
                   |                                    |
            has children                      dont have children
                   |                                    |
                   v                                    v
    - recursion on current's children    - missing loop on current's brothers
    - loop on current's brothers



You may put the optimization test on 'sterile' nodes inside the while (...) loop. Or code a recurse process differently.

oBFusCATed:
I guess you're proposing a fix for the original issue, right?
Can you post a tested patch?  ::)

earlgrey:
Here it is, I did

--- Code: ---diff -au projectmanagerui.cpp@10648 projectmanagerui.cpp@earlgrey > projectmanagerui.cpp.patch
--- End code ---
so you patch with

--- Code: ---patch projectmanagerui.cpp projectmanagerui.cpp.patch
--- End code ---
I :
* added an optimization at method begin
* moved the misplaced original one.
-> bye bye, bug :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version