[gnome-games/wip/exalm/metadata: 13/21] grilo-publisher: Provide empty value



commit 3b8132d1200bb573a70a7e7353cafdace4693d5f
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Tue Oct 9 02:23:37 2018 +0500

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

 src/grilo/grilo-publisher.vala | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/grilo/grilo-publisher.vala b/src/grilo/grilo-publisher.vala
index d2ce09bf..377c039b 100644
--- a/src/grilo/grilo-publisher.vala
+++ b/src/grilo/grilo-publisher.vala
@@ -4,18 +4,16 @@ public class Games.GriloPublisher : Object, Publisher {
        private GriloMedia media;
        private string publisher;
        private bool resolving;
+       private bool resolved;
 
        public GriloPublisher (GriloMedia media) {
                this.media = media;
                media.resolved.connect (on_media_resolved);
-               resolving = false;
+               publisher = "";
        }
 
        public string get_publisher () {
-               if (resolving)
-                       return publisher;
-
-               if (publisher != null)
+               if (resolving || resolved)
                        return publisher;
 
                resolving = true;
@@ -43,6 +41,8 @@ public class Games.GriloPublisher : Object, Publisher {
        private void load_media_publisher (string publisher_string) {
                publisher = publisher_string;
 
+               resolved = true;
+
                changed ();
        }
 }


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