Fix opening wrong friend profile due to sorting, fixes #2313

This commit is contained in:
Marianne Gagnon 2015-09-14 19:04:54 -04:00
parent b9183dde21
commit b3e2924df0

View File

@ -111,9 +111,12 @@ void OnlineProfileFriends::eventCallback(Widget* widget,
} }
else if (name == m_friends_list_widget->m_properties[GUIEngine::PROP_ID]) else if (name == m_friends_list_widget->m_properties[GUIEngine::PROP_ID])
{ {
int index = m_friends_list_widget->getSelectionID(); std::string str_selection = m_friends_list_widget->getSelectionInternalName();
if (index>-1) int id;
new UserInfoDialog(m_visiting_profile->getFriends()[index]); if (StringUtils::parseString(str_selection, &id))
{
new UserInfoDialog(id);
}
} }
} // eventCallback } // eventCallback
@ -219,7 +222,7 @@ void OnlineProfileFriends::displayResults()
: _("Offline") ); : _("Offline") );
row.push_back(ListWidget::ListCell(status, -1, 2, true)); row.push_back(ListWidget::ListCell(status, -1, 2, true));
} }
m_friends_list_widget->addItem("friend", row); m_friends_list_widget->addItem(StringUtils::toString(friends[i]), row);
} }
m_waiting_for_friends = false; m_waiting_for_friends = false;