summarylogtreecommitdiffstats
path: root/Fix-construct-prop.patch
blob: 2432c03c28a9691a6dd08ec05f786b2b50d43514 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
diff --git a/src/API/NotificationType.vala b/src/API/NotificationType.vala
index c3f4420..15ba2ae 100644
--- a/src/API/NotificationType.vala
+++ b/src/API/NotificationType.vala
@@ -5,7 +5,8 @@ public enum Tootle.API.NotificationType {
     FAVOURITE,
     FOLLOW,
     FOLLOW_REQUEST,     // Internal
-    WATCHLIST;          // Internal
+    WATCHLIST,          // Internal
+    NONE;		// Internal
 
     public string to_string () {
         switch (this) {
diff --git a/src/Widgets/Notification.vala b/src/Widgets/Notification.vala
index 3e2fe54..41ed71f 100644
--- a/src/Widgets/Notification.vala
+++ b/src/Widgets/Notification.vala
@@ -16,7 +16,7 @@ public class Tootle.Widgets.Notification : Widgets.Status {
     }
 
     protected override void on_kind_changed () {
-        if (kind == null)
+        if (kind == API.NotificationType.NONE)
             return;
 
         header_icon.visible = header_label.visible = true;
diff --git a/src/Widgets/Status.vala b/src/Widgets/Status.vala
index ef51340..ce1c951 100644
--- a/src/Widgets/Status.vala
+++ b/src/Widgets/Status.vala
@@ -5,7 +5,7 @@ using Gdk;
 public class Tootle.Widgets.Status : ListBoxRow {
 
 	public API.Status status { get; construct set; }
-	public API.NotificationType? kind { get; construct set; }
+	public API.NotificationType kind { get; construct set; }
 
 	public enum ThreadRole {
 		NONE,
@@ -113,7 +113,7 @@ public class Tootle.Widgets.Status : ListBoxRow {
 		notify["kind"].connect (on_kind_changed);
 		open.connect (on_open);
 
-		if (kind == null) {
+		if (kind == API.NotificationType.NONE) {
 			if (status.reblog != null)
 				kind = API.NotificationType.REBLOG_REMOTE_USER;
 		}
@@ -164,7 +164,7 @@ public class Tootle.Widgets.Status : ListBoxRow {
 		menu_button.clicked.connect (open_menu);
 	}
 
-	public Status (owned API.Status status, API.NotificationType? kind = null) {
+	public Status (owned API.Status status, API.NotificationType kind = API.NotificationType.NONE) {
 		Object (
 			status: status,
 			kind: kind
@@ -180,8 +180,8 @@ public class Tootle.Widgets.Status : ListBoxRow {
 	}
 
 	protected virtual void on_kind_changed () {
-		header_icon.visible = header_label.visible = (kind != null);
-		if (kind == null)
+		header_icon.visible = header_label.visible = (kind != API.NotificationType.NONE);
+		if (kind == API.NotificationType.NONE)
 			return;
 
 		header_icon.icon_name = kind.get_icon ();