-------------- Build: Code-completion in Code::Blocks ---------------
[ 9.1%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -DBUILDING_PLUGIN -Iinclude -ID:\wxWidgets-2.8.10\include -ID:\wxWidgets-2.8.10\lib\gcc_dll\mswu -Iinclude\wxscintilla\include -Iinclude\tinyxml -c F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.cpp -o .objs\plugins\codecompletion\classbrowserbuilderthread.o
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.cpp:202: error: prototype for 'void ClassBrowserBuilderThread::BuildTree()' does not match any in class 'ClassBrowserBuilderThread'
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.h:121: error: candidate is: void ClassBrowserBuilderThread::BuildTree(bool)
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.cpp:368: error: prototype for 'wxTreeItemId ClassBrowserBuilderThread::AddNodeIfNotThere(wxTreeCtrl*, wxTreeItemId, const wxString&, int, CBTreeData*, bool)' does not match any in class 'ClassBrowserBuilderThread'
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.h:123: error: candidate is: wxTreeItemId ClassBrowserBuilderThread::AddNodeIfNotThere(wxTreeCtrl*, wxTreeItemId, const wxString&, int, CBTreeData*)
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.cpp:433: error: prototype for 'bool ClassBrowserBuilderThread::AddChildrenOf(wxTreeCtrl*, wxTreeItemId, int, int)' does not match any in class 'ClassBrowserBuilderThread'
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.h:124: error: candidate is: bool ClassBrowserBuilderThread::AddChildrenOf(wxTreeCtrl*, wxTreeItemId, int, int, bool, int)
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.cpp: In member function 'bool ClassBrowserBuilderThread::AddAncestorsOf(wxTreeCtrl*, wxTreeItemId, int)':
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.cpp:479: error: no matching function for call to 'ClassBrowserBuilderThread::AddNodes(wxTreeCtrl*&, wxTreeItemId&, std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>, int, bool)'
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.h:127: note: candidates are: bool ClassBrowserBuilderThread::AddNodes(wxTreeCtrl*, wxTreeItemId, const TokenIdxSet&, int, int, bool, bool)
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.cpp: In member function 'bool ClassBrowserBuilderThread::AddDescendantsOf(wxTreeCtrl*, wxTreeItemId, int, bool)':
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.cpp:494: error: no matching function for call to 'ClassBrowserBuilderThread::AddNodes(wxTreeCtrl*&, wxTreeItemId&, std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>, int, bool)'
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.h:127: note: candidates are: bool ClassBrowserBuilderThread::AddNodes(wxTreeCtrl*, wxTreeItemId, const TokenIdxSet&, int, int, bool, bool)
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.cpp: At global scope:
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.cpp:500: error: prototype for 'bool ClassBrowserBuilderThread::AddNodes(wxTreeCtrl*, wxTreeItemId, std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>, int, bool)' does not match any in class 'ClassBrowserBuilderThread'
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.h:127: error: candidate is: bool ClassBrowserBuilderThread::AddNodes(wxTreeCtrl*, wxTreeItemId, const TokenIdxSet&, int, int, bool, bool)
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.cpp:603: error: no 'void ClassBrowserBuilderThread::SelectNode(wxTreeItemId)' member function declared in class 'ClassBrowserBuilderThread'
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.cpp:752: error: prototype for 'void ClassBrowserBuilderThread::CollapseItem(wxTreeItemId)' does not match any in class 'ClassBrowserBuilderThread'
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.h:116: error: candidate is: void ClassBrowserBuilderThread::CollapseItem(wxTreeItemId, bool)
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.cpp: In member function 'void ClassBrowserBuilderThread::SelectItem(wxTreeItemId)':
F:\newCC\src\plugins\codecompletion\classbrowserbuilderthread.cpp:773: error: 'SelectNode' was not declared in this scope
Process terminated with status 1 (0 minutes, 2 seconds)
14 errors, 0 warnings
It seems like the source file (classbrowserbuilderthread.cpp) was patched,It was the other way round but anyways... try again...
but the header file (classbrowserbuilderthread.h) not.
If a file is opened by context menu-> open #include file "XXXX.h", then the CodeBrowser tree of "XXXX.h" will not be updated.How was that in previous version(s)? Is that really in the new CC branch only?
How was that in previous version(s)? Is that really in the new CC branch only?Yes, at least this bug is not in official nightly build version. :D
void NativeParser::OnEditorActivated(EditorBase* editor)
{
if (!m_pClassBrowser)
return;
cbEditor* ed = editor && editor->IsBuiltinEditor() ? static_cast<cbEditor*>(editor) : 0;
if (ed)
{
Parser* parser = FindParserFromEditor(ed);
if (parser && parser->ClassBrowserOptions().displayFilter == bdfFile)
{
m_pClassBrowser->UpdateView();
}
}
}
But I'm sure the ed == NULL. :D
So, that's the reason why m_pClassBrowser not updated.
But I'm sure the ed == NULL. :D
So, that's the reason why m_pClassBrowser not updated.
Good catch, but this bug is a bug that slipped in with the use of wxAuiNotebook and not new CC.
It seems the editormanager gets the PageChanged event, before the editor is initialized.
In it's PageChanged event-handler it sends the cbEVT_EDITOR_ACTIVATED-event and therefore IsBuiltinEditor() returns false in this case.
I will look into it.
@ollydbg
can not reproduce it.
I just find a serious bug! SVN rev 5942
when any editor is opened, it seems the the CPU usage was 50%, and the title bar of Code::Blocks gets flashed continuously. :(
Does any one meet the same problem, it seems there is no problem before rev 5939.
I can confirm this (on linux).
I have a small plugin, that hooks into C::B event-sink to debug C::B's internal events, and we get flooded with cbEVT_EDITOR_ACTIVATED.
Removing Biplabs commit from svn r5939 fixed this issue.
Just investigated a little deeper:
the BrowseTracker-plugin calls SetActiveEditor in its OnIdle-function (and this one is called quiet often of course).
IMO, code in BrowseTracker plugin should be changed. OnIdle function will be called frequently resulting in flooding of such event.
void BrowseTracker::OnIdle(wxIdleEvent& event)
// ----------------------------------------------------------------------------
{
event.Skip();
// Focus the new selected editor. This doesn't work if a long compile
// is active since there's no idle time. User will have to click into
// the editor window to activate it.
// This used to be done by the CB editor manager, but someone removed the UI hook.
if ((not Manager::Get()->IsAppShuttingDown()) && m_UpdateUIFocusEditor)
{
if (m_UpdateUIFocusEditor)
{
EditorBase* eb = m_UpdateUIFocusEditor;
if (not eb) return;
m_UpdateUIFocusEditor = 0;
Manager::Get()->GetEditorManager()->SetActiveEditor(eb);
eb->SetFocus();
#if defined(LOGGING)
LOGIT( _T("BT OnIdle Focused Editor[%p] Title[%s]"), eb, eb->GetTitle().c_str() );
#endif
// re-sort the browse marks
wxCommandEvent ev;
OnMenuSortBrowse_Marks(ev);
}
}
}
// This used to be done by the CB editor manager, but someone removed the UI hook.:D
IMO, code in BrowseTracker plugin should be changed. OnIdle function will be called frequently resulting in flooding of such event.
Agreed :DCodevoid BrowseTracker::OnIdle(wxIdleEvent& event)
// ----------------------------------------------------------------------------
{
event.Skip();
// Focus the new selected editor. This doesn't work if a long compile
// is active since there's no idle time. User will have to click into
// the editor window to activate it.
// This used to be done by the CB editor manager, but someone removed the UI hook.
if ((not Manager::Get()->IsAppShuttingDown()) && m_UpdateUIFocusEditor)
{
if (m_UpdateUIFocusEditor)
{
EditorBase* eb = m_UpdateUIFocusEditor;
if (not eb) return;
m_UpdateUIFocusEditor = 0;
Manager::Get()->GetEditorManager()->SetActiveEditor(eb);
eb->SetFocus();
#if defined(LOGGING)
LOGIT( _T("BT OnIdle Focused Editor[%p] Title[%s]"), eb, eb->GetTitle().c_str() );
#endif
// re-sort the browse marks
wxCommandEvent ev;
OnMenuSortBrowse_Marks(ev);
}
}
}
Note:Quote// This used to be done by the CB editor manager, but someone removed the UI hook.:D
if(Manager::Get()->GetEditorManager()->GetActiveEditor() != eb)
Manager::Get()->GetEditorManager()->SetActiveEditor(eb);
To fix this issue and be able to still use BrowseTracker, you can add :Codebeforeif(Manager::Get()->GetEditorManager()->GetActiveEditor() != eb)
Codein BrowseTracker's OnIdle.Manager::Get()->GetEditorManager()->SetActiveEditor(eb);
It's maybe only a workaround and I think pecan should look into this code, whether it is still needed or not, so I do not commit it to trunk.
// ----------------------------------------------------------------------------
void BrowseTracker::OnIdle(wxIdleEvent& event)
// ----------------------------------------------------------------------------
{
event.Skip();
// Focus the new selected editor. This doesn't work if a long compile
// is active since there's no idle time. User will have to click into
// the editor window to activate it.
// This used to be done by the CB editor manager, but someone removed the UI hook.
if ((not Manager::Get()->IsAppShuttingDown()) && m_UpdateUIFocusEditor)
{
if (m_UpdateUIFocusEditor)
{
EditorBase* eb = m_UpdateUIFocusEditor;
if (not eb) return;
m_UpdateUIFocusEditor = 0;
if(Manager::Get()->GetEditorManager()->GetActiveEditor() != eb)
{
Manager::Get()->GetEditorManager()->SetActiveEditor(eb);
eb->SetFocus();
}
#if defined(LOGGING)
LOGIT( _T("BT OnIdle Focused Editor[%p] Title[%s]"), eb, eb->GetTitle().c_str() );
#endif
// re-sort the browse marks
wxCommandEvent ev;
OnMenuSortBrowse_Marks(ev);
}
}
}