[gnome-games] GriloDeveloper: Send empty string as default
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] GriloDeveloper: Send empty string as default
- Date: Sun, 26 Aug 2018 18:06:48 +0000 (UTC)
commit cdfa89f9236d29fa837605380f6a090838ea453d
Author: theawless <theawless gmail com>
Date: Sat Aug 25 23:32:20 2018 +0530
GriloDeveloper: Send empty string as default
Developer interface says that string cannot be null. This commit will
prevent lots of null checks.
src/grilo/grilo-developer.vala | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/src/grilo/grilo-developer.vala b/src/grilo/grilo-developer.vala
index 819f99ab..3770da7e 100644
--- a/src/grilo/grilo-developer.vala
+++ b/src/grilo/grilo-developer.vala
@@ -4,18 +4,16 @@ public class Games.GriloDeveloper : Object, Developer {
private GriloMedia media;
private string developer;
private bool resolving;
+ private bool resolved;
public GriloDeveloper (GriloMedia media) {
this.media = media;
media.resolved.connect (on_media_resolved);
- resolving = false;
+ developer = "";
}
public string get_developer () {
- if (resolving)
- return developer;
-
- if (developer != null)
+ if (resolving || resolved)
return developer;
resolving = true;
@@ -42,8 +40,8 @@ public class Games.GriloDeveloper : Object, Developer {
private void load_media_developer (string developer_string) {
developer = developer_string;
- resolving = true;
+ resolved = true;
- changed();
+ changed ();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]