mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-08-26 10:45:02 -05: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:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user