[gnome-games/wip/exalm/metadata: 3/21] grilo-cooperative: Provide empty value



commit e2671ec50f7f3d40586c00f9d4d4dc250c2df89c
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Tue Oct 9 02:29:57 2018 +0500

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

 src/grilo/grilo-cooperative.vala | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/grilo/grilo-cooperative.vala b/src/grilo/grilo-cooperative.vala
index 3729a769..9ab317af 100644
--- a/src/grilo/grilo-cooperative.vala
+++ b/src/grilo/grilo-cooperative.vala
@@ -4,15 +4,16 @@ public class Games.GriloCooperative : Object, Cooperative {
        private GriloMedia media;
        private bool cooperative;
        private bool resolving;
+       private bool resolved;
 
        public GriloCooperative (GriloMedia media) {
                this.media = media;
                media.resolved.connect (on_media_resolved);
-               resolving = false;
+               cooperative = false;
        }
 
        public bool get_cooperative () {
-               if (resolving)
+               if (resolving || resolved)
                        return cooperative;
 
                resolving = true;
@@ -40,6 +41,8 @@ public class Games.GriloCooperative : Object, Cooperative {
        private void load_media_cooperative (bool coop) {
                cooperative = coop;
 
+               resolved = true;
+
                changed ();
        }
 }


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