mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 00:55:09 -07:00
[GamesModel] Clear games types before merging (#7156)
Took 7 minutes Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
88aa036f7e
commit
fc0199d3db
1 changed files with 3 additions and 0 deletions
|
|
@ -285,6 +285,9 @@ void GamesModel::updateGameList(const ServerInfo_Game &game)
|
|||
gameList.removeAt(i);
|
||||
endRemoveRows();
|
||||
} else {
|
||||
// MergeFrom concatenates repeated fields instead of replacing them,
|
||||
// so clear game_types first to avoid duplicated entries.
|
||||
gameList[i].clear_game_types();
|
||||
gameList[i].MergeFrom(game);
|
||||
emit dataChanged(index(i, 0), index(i, NUM_COLS - 1));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue