Code::Blocks Forums

User forums => Help => Topic started by: ollydbg on November 02, 2011, 03:18:57 pm

Title: reparse project or reparse file does not woks any more
Post by: ollydbg on November 02, 2011, 03:18:57 pm
I just found that in rev 6546(trunk, build my self), in the project tree, If I right mouse click, and select "reparse this project" or "reparse this file",  both of them does not work, any one can reproduce this bug? I have also tried the latest nightly build, and looks like the bug is still there.

Thanks.
Title: Re: reparse project or reparse file does not woks any more
Post by: ollydbg on November 02, 2011, 03:22:42 pm
It looks like:
Code
void NativeParser::ReparseSelectedProject()
{
    wxTreeCtrl* tree = Manager::Get()->GetProjectManager()->GetTree();
    if (!tree)
        return;

    wxTreeItemId treeItem =  tree->GetSelection();
    if (!treeItem.IsOk())
        return;

    const FileTreeData* data = static_cast<FileTreeData*>(tree->GetItemData(treeItem));
    if (!data)
        return;

    if (data->GetKind() == FileTreeData::ftdkProject)
    {
        cbProject* project = data->GetProject();
        if (project)
        {
            DeleteParser(project);
            CreateParser(project);
        }
    }
}

Then, we always return from this:
Code
    wxTreeItemId treeItem =  tree->GetSelection();
    if (!treeItem.IsOk())
        return;
Why?
Title: Re: reparse project or reparse file does not woks any more
Post by: oBFusCATed on November 02, 2011, 03:27:37 pm
Because the selection is not valid...
Do you have selection in the tree control?
Title: Re: reparse project or reparse file does not woks any more
Post by: ollydbg on November 03, 2011, 01:17:52 am
Because the selection is not valid...
Do you have selection in the tree control?
Yes, I have select the project(cbp), and do mouse right click. So, I'm sure it was selected.