[gnome-games/wip/exalm/cache2: 14/25] publisher: Add 'has-loaded' property and remove changed()



commit e9be7d8b6c98ddc9f1ed4a5b168b46b00a3ad679
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Tue Oct 2 18:56:22 2018 +0500

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

 src/core/publisher.vala            | 2 +-
 src/dummy/dummy-publisher.vala     | 2 ++
 src/generic/generic-publisher.vala | 6 ++++++
 src/grilo/grilo-publisher.vala     | 4 +++-
 4 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/core/publisher.vala b/src/core/publisher.vala
index f50ea2c9..753542d2 100644
--- a/src/core/publisher.vala
+++ b/src/core/publisher.vala
@@ -1,7 +1,7 @@
 // This file is part of GNOME Games. License: GPL-3.0+.
 
 public interface Games.Publisher : Object {
-       public signal void changed ();
+       public abstract bool has_loaded { get; protected set; }
 
        public abstract string get_publisher ();
 }
diff --git a/src/dummy/dummy-publisher.vala b/src/dummy/dummy-publisher.vala
index 95fdb71f..09757126 100644
--- a/src/dummy/dummy-publisher.vala
+++ b/src/dummy/dummy-publisher.vala
@@ -1,6 +1,8 @@
 // This file is part of GNOME Games. License: GPL-3.0+.
 
 public class Games.DummyPublisher : Object, Publisher {
+       public bool has_loaded { get; protected set; }
+
        public string get_publisher () {
                return _("Publisher not available.");
        }
diff --git a/src/generic/generic-publisher.vala b/src/generic/generic-publisher.vala
index bbebea9c..0945d33c 100644
--- a/src/generic/generic-publisher.vala
+++ b/src/generic/generic-publisher.vala
@@ -3,6 +3,12 @@
 public class Games.GenericPublisher : Object, Publisher {
        private string publisher;
 
+       public bool has_loaded { get; protected set; }
+
+       construct {
+               has_loaded = true;
+       }
+
        public GenericPublisher (string publisher) {
                this.publisher = publisher;
        }
diff --git a/src/grilo/grilo-publisher.vala b/src/grilo/grilo-publisher.vala
index d2ce09bf..b0c8d175 100644
--- a/src/grilo/grilo-publisher.vala
+++ b/src/grilo/grilo-publisher.vala
@@ -5,6 +5,8 @@ public class Games.GriloPublisher : Object, Publisher {
        private string publisher;
        private bool resolving;
 
+       public bool has_loaded { get; protected set; }
+
        public GriloPublisher (GriloMedia media) {
                this.media = media;
                media.resolved.connect (on_media_resolved);
@@ -43,6 +45,6 @@ public class Games.GriloPublisher : Object, Publisher {
        private void load_media_publisher (string publisher_string) {
                publisher = publisher_string;
 
-               changed ();
+               has_loaded = true;
        }
 }


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