[gnome-games/wip/exalm/metadata: 10/21] grilo-players: Provide empty value



commit 92014b1c295657e2c9b9749b072fdcb411d03b1b
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Tue Oct 9 02:24:27 2018 +0500

    grilo-players: Provide empty value
    
    Return empty string instead of null while it's loading.

 src/grilo/grilo-players.vala | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/grilo/grilo-players.vala b/src/grilo/grilo-players.vala
index e31f0943..445a2a24 100644
--- a/src/grilo/grilo-players.vala
+++ b/src/grilo/grilo-players.vala
@@ -4,18 +4,16 @@ public class Games.GriloPlayers : Object, Players {
        private GriloMedia media;
        private string players;
        private bool resolving;
+       private bool resolved;
 
        public GriloPlayers (GriloMedia media) {
                this.media = media;
                media.resolved.connect (on_media_resolved);
-               resolving = false;
+               players = "";
        }
 
        public string get_players () {
-               if (resolving)
-                       return players;
-
-               if (players != null)
+               if (resolving || resolved)
                        return players;
 
                resolving = true;
@@ -49,6 +47,8 @@ public class Games.GriloPlayers : Object, Players {
        private void load_media_players (string player) {
                players = player;
 
+               resolved = true;
+
                changed ();
        }
 }


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