diff --git a/Adhere-to-GLib.Object-naming-conventions.patch b/Adhere-to-GLib.Object-naming-conventions.patch new file mode 100644 index 0000000..6c48de8 --- /dev/null +++ b/Adhere-to-GLib.Object-naming-conventions.patch @@ -0,0 +1,69 @@ +From da4bcf5afa1df36fb5c6cb2dc175600911252d9b Mon Sep 17 00:00:00 2001 +From: Clayton Craft +Date: Tue, 26 Oct 2021 15:03:25 -0700 +Subject: [PATCH] Adhere to GLib.Object naming conventions for properties + +Vala now validates property names against GLib.Object conventions, this +fixes a compilation error as a result of this enforcement: + +../src/API/Status.vala:27.5-27.23: error: Name `_url' is not valid for a GLib.Object property + public string? _url { get; set; } + ^^^^^^^^^^^^^^^^^^^ + +Relevant Vala change: +https://gitlab.gnome.org/GNOME/vala/-/commit/38d61fbff037687ea4772e6df85c7e22a74b335e + +fixes #337 + +Signed-off-by: Clayton Craft +--- + src/API/Attachment.vala | 6 +++--- + src/API/Status.vala | 8 ++++---- + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/src/API/Attachment.vala b/src/API/Attachment.vala +index 5c66e79..3749bd7 100644 +--- a/src/API/Attachment.vala ++++ b/src/API/Attachment.vala +@@ -32,10 +32,10 @@ public class Tootle.API.Attachment : Entity { + public string kind { get; set; } + public string url { get; set; } + public string? description { get; set; } +- public string? _preview_url { get; set; } ++ private string? t_preview_url { get; set; } + public string? preview_url { +- set { this._preview_url = value; } +- get { return (this._preview_url == null || this._preview_url == "") ? url : _preview_url; } ++ set { this.t_preview_url = value; } ++ get { return (this.t_preview_url == null || this.t_preview_url == "") ? url : t_preview_url; } + } + + public static Attachment from (Json.Node node) throws Error { +diff --git a/src/API/Status.vala b/src/API/Status.vala +index 4de9b9d..7ebb2e5 100644 +--- a/src/API/Status.vala ++++ b/src/API/Status.vala +@@ -24,16 +24,16 @@ public class Tootle.API.Status : Entity, Widgetizable { + public ArrayList? mentions { get; set; default = null; } + public ArrayList? media_attachments { get; set; default = null; } + +- public string? _url { get; set; } ++ private string? t_url { get; set; } + public string url { + owned get { return this.get_modified_url (); } +- set { this._url = value; } ++ set { this.t_url = value; } + } + string get_modified_url () { +- if (this._url == null) { ++ if (this.t_url == null) { + return this.uri.replace ("/activity", ""); + } +- return this._url; ++ return this.t_url; + } + + public Status formal { +-- +2.33.1 + diff --git a/Application-make-app_entries-private.patch b/Application-make-app_entries-private.patch new file mode 100644 index 0000000..31edff7 --- /dev/null +++ b/Application-make-app_entries-private.patch @@ -0,0 +1,26 @@ +From ee278f143f307dd1396afe3eb79237a027cc7b90 Mon Sep 17 00:00:00 2001 +From: Bobby Rong +Date: Sat, 19 Mar 2022 16:59:31 +0800 +Subject: [PATCH] Application: make app_entries private + +Fixes compilation with latest valac. +--- + src/Application.vala | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Application.vala b/src/Application.vala +index 3b2c9b9..09556bb 100644 +--- a/src/Application.vala ++++ b/src/Application.vala +@@ -43,7 +43,7 @@ namespace Tootle { + { null } + }; + +- public const GLib.ActionEntry[] app_entries = { ++ private const GLib.ActionEntry[] app_entries = { + { "about", about_activated }, + { "compose", compose_activated }, + { "back", back_activated }, +-- +2.35.1 + diff --git a/Fix-construct-prop.patch b/Fix-construct-prop.patch new file mode 100644 index 0000000..2432c03 --- /dev/null +++ b/Fix-construct-prop.patch @@ -0,0 +1,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 (); diff --git a/Use-reason_phrase-instead-of-get_phrase.patch b/Use-reason_phrase-instead-of-get_phrase.patch new file mode 100644 index 0000000..432bc4c --- /dev/null +++ b/Use-reason_phrase-instead-of-get_phrase.patch @@ -0,0 +1,51 @@ +From 858ee78fbebe161a4cdd707a469dc0f045211a51 Mon Sep 17 00:00:00 2001 +From: Max Harmathy +Date: Wed, 25 Aug 2021 13:05:58 +0200 +Subject: [PATCH] Use reason_phrase instead of get_phrase + +--- + src/Services/Cache.vala | 2 +- + src/Services/Network.vala | 7 +------ + 2 files changed, 2 insertions(+), 7 deletions(-) + +diff --git a/src/Services/Cache.vala b/src/Services/Cache.vala +index 2251697..2ed314e 100644 +--- a/src/Services/Cache.vala ++++ b/src/Services/Cache.vala +@@ -88,7 +88,7 @@ public class Tootle.Cache : GLib.Object { + try { + var code = msg.status_code; + if (code != Soup.Status.OK) { +- var error = network.describe_error (code); ++ var error = msg.reason_phrase; + throw new Oopsie.INSTANCE (@"Server returned $error"); + } + +diff --git a/src/Services/Network.vala b/src/Services/Network.vala +index fa2839c..d0143b0 100644 +--- a/src/Services/Network.vala ++++ b/src/Services/Network.vala +@@ -56,7 +56,7 @@ public class Tootle.Network : GLib.Object { + else if (status == Soup.Status.CANCELLED) + debug ("Message is cancelled. Ignoring callback invocation."); + else +- ecb ((int32) status, describe_error ((int32) status)); ++ ecb ((int32) status, msg.reason_phrase); + }); + } + catch (Error e) { +@@ -65,11 +65,6 @@ public class Tootle.Network : GLib.Object { + } + } + +- public string describe_error (uint code) { +- var reason = Soup.Status.get_phrase (code); +- return @"$code: $reason"; +- } +- + public void on_error (int32 code, string message) { + warning (message); + app.toast (message); +-- +2.33.0 + diff --git a/com.github.bleakgrey.tootle.json b/com.github.bleakgrey.tootle.json index 9795a02..4c436a6 100644 --- a/com.github.bleakgrey.tootle.json +++ b/com.github.bleakgrey.tootle.json @@ -2,7 +2,7 @@ "app-id": "com.github.bleakgrey.tootle", "runtime": "org.gnome.Platform", "sdk": "org.gnome.Sdk", - "runtime-version": "40", + "runtime-version": "42", "command": "com.github.bleakgrey.tootle", "finish-args": [ "--share=network", @@ -24,32 +24,32 @@ ], "modules": [ { - "name": "libhandy", - "buildsystem": "meson", + "name": "tootle", "builddir": true, - "config-opts": [ - "-Dexamples=false", - "-Dtests=false", - "-Dglade_catalog=disabled" - ], + "buildsystem": "meson", "sources": [ { "type": "archive", - "url": "https://gitlab.gnome.org/GNOME/libhandy/-/archive/1.0.1/libhandy-1.0.1.tar", - "sha256": "86da467c3723c81fc6f1105945141cea1e9698a6bb3075637bfb58b2cbfeccd0" + "url": "https://github.com/bleakgrey/tootle/archive/1.0.zip", + "sha256": "2a398aaddc22a70948bb03d6eb5e64a7ee1f5c63679315939ba47f7938001532" + }, + { + "type": "patch", + "path": "Use-reason_phrase-instead-of-get_phrase.patch" + }, + { + "type": "patch", + "path": "Adhere-to-GLib.Object-naming-conventions.patch" + }, + { + "type": "patch", + "path": "Application-make-app_entries-private.patch" + }, + { + "type": "patch", + "path": "Fix-construct-prop.patch" } ] - }, - { - "name": "tootle", - "builddir": true, - "buildsystem": "meson", - "sources": [{ - "type": "archive", - "url": "https://github.com/bleakgrey/tootle/archive/1.0.zip", - "sha256": "2a398aaddc22a70948bb03d6eb5e64a7ee1f5c63679315939ba47f7938001532" - }] } - ] }