How is CGUIBaseContainer::m_items filled in?
#1
I am trying to understand how Kodi components are initialized and I am stuck with a problem to trace how the items list in containers is created.

I believe the items are stored in the CGUIBaseContainer property:
Code:
std::vector< CGUIListItemPtr > m_items;

but I fail to understand how is this list is populated when the component is created? For a moment I thought it was done through the UpdateListProvider() function, which is apparently not systematically invoked...

anyone could point me to the right direction?

Thank you in advance,
Pierre
Reply
#2
ok, it took me a while and it seems obvious now, but if anyone else get lost in code as I did, here is the call stack leading to the container's list being populated (for the media window, others probably use a similar mechanism):

CGUIMediaWindow::Update() : Scans the db for content, builds m_vecItems with the result of the query, then calls:
CGUIMediaWindow::OnFilterItems() : Filter and sorts the content then calls:
CGUIViewControl::SetItems(): calls :
CGUIViewControl::UpdateView(): calls :
CGUIViewControl::UpdateContents(): broadcasts a message GUI_MSG_LABEL_BIND
CGUIBaseContainer::OnMessage(): will process the message, and copy the items list into the CGUIBaseContainer::m_items property
Reply

Logout Mark Read Team Forum Stats Members Help
How is CGUIBaseContainer::m_items filled in?0