[gnome-games/wip/exalm/cache2: 23/45] database-game: Use only one developer per game



commit 6b5e50db94382f9924c8f2205b43f837ec6cc829
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Mon Oct 1 02:08:49 2018 +0500

    database-game: Use only one developer per game
    
    Creating a new DatabaseDeveloper each time makes it impossible to connect
    to developer signals and receive notifications, so only use one object.

 src/database/database-game.vala | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/database/database-game.vala b/src/database/database-game.vala
index fe322f5b..f9175a72 100644
--- a/src/database/database-game.vala
+++ b/src/database/database-game.vala
@@ -8,9 +8,13 @@ private class Games.DatabaseGame : Object, Game {
        private Database database;
        private Game game;
 
+       private Developer developer;
+
        public DatabaseGame (Database database, Game game) {
                this.database = database;
                this.game = game;
+
+               developer = database.get_developer (game.get_developer (), get_uid ());
        }
 
        public Uid get_uid () {
@@ -42,7 +46,7 @@ private class Games.DatabaseGame : Object, Game {
        }
 
        public Developer get_developer () {
-               return database.get_developer (game.get_developer (), get_uid ());
+               return developer;
        }
 
        public Publisher get_publisher () {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]