From 0e6ff3e7021b2e72f02b22550bbb96bc3674cba4 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 3 Jan 2013 14:37:24 -0800 Subject: CHUI-654 : Fixed! Select the Nearby Chat directly when one conversation only left, don't finesse with a root UUID that might not be NULL --- indra/newview/llfloaterimcontainer.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'indra/newview/llfloaterimcontainer.cpp') diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 50acd4ae24..9fe67e99da 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1430,11 +1430,10 @@ bool LLFloaterIMContainer::removeConversationListItem(const LLUUID& uuid, bool c { is_widget_selected = widget->isSelected(); new_selection = mConversationsRoot->getNextFromChild(widget); - if(new_selection == NULL) + if (!new_selection) { new_selection = mConversationsRoot->getPreviousFromChild(widget); } - widget->destroyView(); } @@ -1446,14 +1445,20 @@ bool LLFloaterIMContainer::removeConversationListItem(const LLUUID& uuid, bool c if (change_focus) { setFocus(TRUE); - if(new_selection != NULL) + if (new_selection) { if (mConversationsWidgets.size() == 1) - new_selection = new_selection->getParentFolder(); - LLConversationItem* vmi = dynamic_cast(new_selection->getViewModelItem()); - if(vmi != NULL) { - selectConversationPair(vmi->getUUID(), true); + // If only one widget is left, it has to be the Nearby Chat. Select it directly. + selectConversationPair(LLUUID(NULL), true); + } + else + { + LLConversationItem* vmi = dynamic_cast(new_selection->getViewModelItem()); + if (vmi) + { + selectConversationPair(vmi->getUUID(), true); + } } } } -- cgit v1.2.3