[gnome-games/wip/exalm/metadata: 8/21] grilo-genre: Provide empty value
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/metadata: 8/21] grilo-genre: Provide empty value
- Date: Mon, 8 Oct 2018 21:42:29 +0000 (UTC)
commit 26aa2ca16aa62900cd13cd0aeb73bd4d04ec9359
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Tue Oct 9 02:30:14 2018 +0500
grilo-genre: Provide empty value
Return empty string array instead of null while it's loading.
src/grilo/grilo-genre.vala | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/grilo/grilo-genre.vala b/src/grilo/grilo-genre.vala
index 32e6b7ad..274583dd 100644
--- a/src/grilo/grilo-genre.vala
+++ b/src/grilo/grilo-genre.vala
@@ -4,18 +4,16 @@ public class Games.GriloGenre : Object, Genre {
private GriloMedia media;
private string[] genre;
private bool resolving;
+ private bool resolved;
public GriloGenre (GriloMedia media) {
this.media = media;
media.resolved.connect (on_media_resolved);
- resolving = false;
+ genre = {};
}
public unowned string[] get_genre () {
- if (resolving)
- return genre;
-
- if (genre != null)
+ if (resolving || resolved)
return genre;
resolving = true;
@@ -46,6 +44,8 @@ public class Games.GriloGenre : Object, Genre {
private void load_media_genre (string[] genres) {
genre = genres.copy ();
+ resolved = true;
+
changed ();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]