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
This commit is contained in:
@@ -332,10 +332,10 @@ TeamsListView::_UpdateList()
|
|||||||
// Team not found in previously known teams list: insert a new item
|
// Team not found in previously known teams list: insert a new item
|
||||||
TeamListItem* newItem = new(std::nothrow) TeamListItem(tmi);
|
TeamListItem* newItem = new(std::nothrow) TeamListItem(tmi);
|
||||||
if (newItem != NULL) {
|
if (newItem != NULL) {
|
||||||
if (!item)
|
if (!item) // No item found with bigger team id: append at end
|
||||||
index++; // No item found with bigger team id: insert at end
|
AddItem(newItem);
|
||||||
|
else
|
||||||
AddItem(newItem, index);
|
AddItem(newItem, index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
index++; // Move list sync head.
|
index++; // Move list sync head.
|
||||||
|
|||||||
Reference in New Issue
Block a user