CHUI-469 : Fixed. Add the widget to its map, init the widget map consistently and correctly.

meow-7.2.2
Merov Linden 2012-10-29 16:59:53 -07:00
parent 09282019ef
commit 480c3a1acb
2 changed files with 13 additions and 6 deletions

View File

@ -50,6 +50,7 @@ LLIMConversation::LLIMConversation(const LLSD& session_id)
, mCloseBtn(NULL)
, mSessionID(session_id.asUUID())
// , mParticipantList(NULL)
, mConversationsRoot(NULL)
, mChatHistory(NULL)
, mInputEditor(NULL)
, mInputEditorTopPad(0)
@ -309,6 +310,15 @@ void LLIMConversation::appendMessage(const LLChat& chat, const LLSD &args)
void LLIMConversation::buildConversationViewParticipant()
{
// Clear the widget list since we are rebuilding afresh from the model
conversations_widgets_map::iterator widget_it = mConversationsWidgets.begin();
while (widget_it != mConversationsWidgets.end())
{
removeConversationViewParticipant(widget_it->first);
// Iterators are invalidated by erase so we need to pick begin again
widget_it = mConversationsWidgets.begin();
}
// Get the model list
LLParticipantList* item = getParticipantList();
if (!item)
@ -342,7 +352,7 @@ void LLIMConversation::addConversationViewParticipant(LLConversationItem* partic
else
{
LLConversationViewParticipant* participant_view = createConversationViewParticipant(participant_model);
mConversationsWidgets[uuid] = widget;
mConversationsWidgets[uuid] = participant_view;
participant_view->addToFolder(mConversationsRoot);
participant_view->setVisible(TRUE);
refreshConversation();
@ -373,10 +383,10 @@ void LLIMConversation::updateConversationViewParticipant(const LLUUID& participa
void LLIMConversation::refreshConversation()
{
// *TODO: update the conversation name
// *TODO: check that all participant models do have a view (this is a consistency check)
// *TODO: check that all participant models do have a view (debug consistency check)
mConversationViewModel.requestSortAll();
mConversationsRoot->arrangeAll();
mConversationsRoot->update();
}
// Copied from LLIMFloaterContainer::createConversationViewParticipant(). Refactor opportunity!
@ -392,8 +402,6 @@ LLConversationViewParticipant* LLIMConversation::createConversationViewParticipa
params.tool_tip = params.name;
params.participant_id = item->getUUID();
llinfos << "Merov debug : LLIMConversation, create participant, name = " << item->getDisplayName() << llendl;
return LLUICtrlFactory::create<LLConversationViewParticipant>(params);
}

View File

@ -129,7 +129,6 @@ void LLIMFloaterContainer::onCurrentChannelChanged(const LLUUID& session_id)
{
if (session_id != LLUUID::null)
{
llinfos << "Merov debug : onCurrentChannelChanged, LLIMFloater::show, id = " << session_id << llendl;
LLIMFloater::show(session_id);
}
}