[gnome-games/wip/exalm/cache2: 10/23] cooperative: Add 'has-loaded' property and remove changed()



commit 16f8bb4b217d81b58b462d512b26a787dee27e97
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Tue Oct 2 18:54:47 2018 +0500

    cooperative: Add 'has-loaded' property and remove changed()

 src/core/cooperative.vala            | 2 +-
 src/dummy/dummy-cooperative.vala     | 2 ++
 src/generic/generic-cooperative.vala | 6 ++++++
 src/grilo/grilo-cooperative.vala     | 4 +++-
 4 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/core/cooperative.vala b/src/core/cooperative.vala
index 40945b3d..ffc62fbf 100644
--- a/src/core/cooperative.vala
+++ b/src/core/cooperative.vala
@@ -1,7 +1,7 @@
 // This file is part of GNOME Games. License: GPL-3.0+.
 
 public interface Games.Cooperative : Object {
-       public signal void changed ();
+       public abstract bool has_loaded { get; protected set; }
 
        public abstract bool get_cooperative ();
 }
diff --git a/src/dummy/dummy-cooperative.vala b/src/dummy/dummy-cooperative.vala
index a5aff939..b0e4b7d7 100644
--- a/src/dummy/dummy-cooperative.vala
+++ b/src/dummy/dummy-cooperative.vala
@@ -1,6 +1,8 @@
 // This file is part of GNOME Games. License: GPL-3.0+.
 
 public class Games.DummyCooperative : Object, Cooperative {
+       public bool has_loaded { get; protected set; }
+
        public bool get_cooperative () {
                return false;
        }
diff --git a/src/generic/generic-cooperative.vala b/src/generic/generic-cooperative.vala
index 8073a25e..a3e4a918 100644
--- a/src/generic/generic-cooperative.vala
+++ b/src/generic/generic-cooperative.vala
@@ -3,6 +3,12 @@
 public class Games.GenericCooperative : Object, Cooperative {
        private bool cooperative;
 
+       public bool has_loaded { get; protected set; }
+
+       construct {
+               has_loaded = true;
+       }
+
        public GenericCooperative (bool cooperative) {
                this.cooperative = cooperative;
        }
diff --git a/src/grilo/grilo-cooperative.vala b/src/grilo/grilo-cooperative.vala
index 3729a769..ca792e71 100644
--- a/src/grilo/grilo-cooperative.vala
+++ b/src/grilo/grilo-cooperative.vala
@@ -5,6 +5,8 @@ public class Games.GriloCooperative : Object, Cooperative {
        private bool cooperative;
        private bool resolving;
 
+       public bool has_loaded { get; protected set; }
+
        public GriloCooperative (GriloMedia media) {
                this.media = media;
                media.resolved.connect (on_media_resolved);
@@ -40,6 +42,6 @@ public class Games.GriloCooperative : Object, Cooperative {
        private void load_media_cooperative (bool coop) {
                cooperative = coop;
 
-               changed ();
+               has_loaded = true;
        }
 }


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