[gnome-games] game-model: Decrement n_games when a game is removed
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] game-model: Decrement n_games when a game is removed
- Date: Tue, 30 Jun 2020 10:52:06 +0000 (UTC)
commit 696419378c9b3edfffbe8f529387106c5458781b
Author: Neville <nevilleantony98 gmail com>
Date: Thu Jun 18 21:42:22 2020 +0530
game-model: Decrement n_games when a game is removed
When a game is removed from the model, n_games wasn't decremented which
leads to several criticals and unwanted behavior because of wrong game
count.
src/core/game-model.vala | 1 +
1 file changed, 1 insertion(+)
---
diff --git a/src/core/game-model.vala b/src/core/game-model.vala
index e17273a0..fe3e8872 100644
--- a/src/core/game-model.vala
+++ b/src/core/game-model.vala
@@ -52,6 +52,7 @@ private class Games.GameModel : Object, ListModel {
var pos = iter.get_position ();
iter.remove ();
+ n_games--;
items_changed (pos, 1, 0);
game_removed (game);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]