[gnome-games/wip/exalm/cache2: 35/45] publisher: Add 'has-loaded' property and remove changed()
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/cache2: 35/45] publisher: Add 'has-loaded' property and remove changed()
- Date: Mon, 8 Oct 2018 22:36:52 +0000 (UTC)
commit beb3a09d7ecb8bfab03736493706033a7fb438d0
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 | 9 ++++-----
4 files changed, 13 insertions(+), 6 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 0ddb432a..82e1dd18 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 "";
}
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 ee5c7efe..035ce95c 100644
--- a/src/grilo/grilo-publisher.vala
+++ b/src/grilo/grilo-publisher.vala
@@ -4,7 +4,8 @@ public class Games.GriloPublisher : Object, Publisher {
private GriloMedia media;
private string publisher;
private bool resolving;
- private bool resolved;
+
+ public bool has_loaded { get; protected set; }
public GriloPublisher (GriloMedia media) {
this.media = media;
@@ -13,7 +14,7 @@ public class Games.GriloPublisher : Object, Publisher {
}
public string get_publisher () {
- if (resolving || resolved)
+ if (resolving || has_loaded)
return publisher;
resolving = true;
@@ -36,8 +37,6 @@ public class Games.GriloPublisher : Object, Publisher {
publisher = grl_media.get_string (metadata_key);
- resolved = true;
-
- changed ();
+ has_loaded = true;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]