From 7fa49587bc9339d0fc355e2239e2840fa60fdc5f Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Tue, 28 Sep 2010 10:36:40 +0000 Subject: [PATCH] Fix a bug in _UpdateList(), where the newest teams were not append at all due to an out-of-range index passed to AddItem(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38832 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../user_interface/gui/teams_window/TeamsListView.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.cpp b/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.cpp index b0345f21c5..2afe0d2a61 100644 --- a/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.cpp +++ b/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.cpp @@ -332,10 +332,10 @@ TeamsListView::_UpdateList() // Team not found in previously known teams list: insert a new item TeamListItem* newItem = new(std::nothrow) TeamListItem(tmi); if (newItem != NULL) { - if (!item) - index++; // No item found with bigger team id: insert at end - - AddItem(newItem, index); + if (!item) // No item found with bigger team id: append at end + AddItem(newItem); + else + AddItem(newItem, index); } } index++; // Move list sync head.