From aebc4e44404a7336f532daa7465cdfc4ffc8379f Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Tue, 20 May 2025 10:18:41 +0300 Subject: [PATCH 1/2] feat: Drop all explicit GLib.Type.ensure () calls Apparently, Vala has been doing this for us since 2014, see https://gitlab.gnome.org/GNOME/vala/-/commit/8f9979da7a75cb91a46e47e61bf35a41c8ff8083 Signed-off-by: Sergey Bugaev --- src/Dialogs/MainWindow.vala | 5 ----- src/Dialogs/Preferences.vala | 4 ---- src/Dialogs/ProfileEdit.vala | 4 ---- src/Views/MediaViewer.vala | 4 ---- src/Views/Sidebar.vala | 2 -- src/Widgets/Account.vala | 8 -------- src/Widgets/PreviewCard.vala | 4 ---- src/Widgets/PreviewCardExplore.vala | 4 ---- src/Widgets/ProfileCover.vala | 8 -------- src/Widgets/Status.vala | 7 ------- 10 files changed, 50 deletions(-) diff --git a/src/Dialogs/MainWindow.vala b/src/Dialogs/MainWindow.vala index e39eba3a2..bf8e96c6b 100644 --- a/src/Dialogs/MainWindow.vala +++ b/src/Dialogs/MainWindow.vala @@ -14,11 +14,6 @@ public class Tuba.Dialogs.MainWindow: Adw.ApplicationWindow, Saveable { Views.Base? last_view = null; - static construct { - typeof (Views.MediaViewer).ensure (); - typeof (Views.Sidebar).ensure (); - } - construct { construct_saveable (settings); diff --git a/src/Dialogs/Preferences.vala b/src/Dialogs/Preferences.vala index dd12c3b90..1bbdf2a0b 100644 --- a/src/Dialogs/Preferences.vala +++ b/src/Dialogs/Preferences.vala @@ -172,10 +172,6 @@ public class Tuba.Dialogs.Preferences : Adw.PreferencesDialog { private bool lang_changed { get; set; default=false; } private bool privacy_changed { get; set; default=false; } - static construct { - typeof (ColorSchemeListModel).ensure (); - } - construct { proxy_entry.text = settings.proxy; post_visibility_combo_row.model = accounts.active.visibility_list; diff --git a/src/Dialogs/ProfileEdit.vala b/src/Dialogs/ProfileEdit.vala index 1288a4667..fbf06d292 100644 --- a/src/Dialogs/ProfileEdit.vala +++ b/src/Dialogs/ProfileEdit.vala @@ -80,10 +80,6 @@ public class Tuba.Dialogs.ProfileEdit : Adw.Dialog { name = _("All Supported Files") }; - static construct { - typeof (Widgets.CustomEmojiChooser).ensure (); - } - construct { filter.add_mime_type ("image/jpeg"); filter.add_mime_type ("image/png"); diff --git a/src/Views/MediaViewer.vala b/src/Views/MediaViewer.vala index 98158b9ba..eebd4ffbe 100644 --- a/src/Views/MediaViewer.vala +++ b/src/Views/MediaViewer.vala @@ -427,10 +427,6 @@ public class Tuba.Views.MediaViewer : Gtk.Widget, Gtk.Buildable, Adw.Swipeable { } } - static construct { - typeof (Widgets.ScaleRevealer).ensure (); - } - #if CLAPPER string clapper_cache_dir; Gee.HashMap clapper_cached_urls; diff --git a/src/Views/Sidebar.vala b/src/Views/Sidebar.vala index 1f61939b6..01dd17d12 100644 --- a/src/Views/Sidebar.vala +++ b/src/Views/Sidebar.vala @@ -52,8 +52,6 @@ public class Tuba.Views.Sidebar : Gtk.Widget, AccountHolder { } static construct { - typeof (Widgets.Avatar).ensure (); - typeof (Widgets.EmojiLabel).ensure (); set_layout_manager_type (typeof (Gtk.BinLayout)); } diff --git a/src/Widgets/Account.vala b/src/Widgets/Account.vala index 0a6160172..38dd12e4f 100644 --- a/src/Widgets/Account.vala +++ b/src/Widgets/Account.vala @@ -38,14 +38,6 @@ public class Tuba.Widgets.Account : Gtk.ListBoxRow { } } - static construct { - typeof (Widgets.Background).ensure (); - typeof (Widgets.Avatar).ensure (); - typeof (RelationshipButton).ensure (); - typeof (Widgets.EmojiLabel).ensure (); - typeof (Widgets.MarkupView).ensure (); - } - [GtkChild] unowned Widgets.Background background; [GtkChild] unowned Gtk.Overlay cover_overlay; [GtkChild] unowned Gtk.Label cover_badge; diff --git a/src/Widgets/PreviewCard.vala b/src/Widgets/PreviewCard.vala index c1ec1f073..92e878c0f 100644 --- a/src/Widgets/PreviewCard.vala +++ b/src/Widgets/PreviewCard.vala @@ -4,10 +4,6 @@ public class Tuba.Widgets.PreviewCard : Gtk.Box { debug ("Destroying PreviewCard"); } - static construct { - typeof (Widgets.PreviewCardInternal).ensure (); - } - [GtkChild] public unowned Gtk.Button button; [GtkChild] unowned Widgets.PreviewCardInternal box; diff --git a/src/Widgets/PreviewCardExplore.vala b/src/Widgets/PreviewCardExplore.vala index e3d58a0ef..900563c22 100644 --- a/src/Widgets/PreviewCardExplore.vala +++ b/src/Widgets/PreviewCardExplore.vala @@ -4,10 +4,6 @@ public class Tuba.Widgets.PreviewCardExplore : Gtk.ListBoxRow { debug ("Destroying PreviewCardExplore"); } - static construct { - typeof (Widgets.PreviewCardInternal).ensure (); - } - [GtkChild] unowned Widgets.PreviewCardInternal box; private string url; diff --git a/src/Widgets/ProfileCover.vala b/src/Widgets/ProfileCover.vala index 1674937e4..6530dde70 100644 --- a/src/Widgets/ProfileCover.vala +++ b/src/Widgets/ProfileCover.vala @@ -1,13 +1,5 @@ [GtkTemplate (ui = "/dev/geopjr/Tuba/ui/views/profile_header.ui")] protected class Tuba.Widgets.Cover : Gtk.Box { - static construct { - typeof (Widgets.Background).ensure (); - typeof (Widgets.Avatar).ensure (); - typeof (Widgets.RelationshipButton).ensure (); - typeof (Widgets.EmojiLabel).ensure (); - typeof (Widgets.MarkupView).ensure (); - } - public class MutualsButtonContent : Gtk.Box { Gtk.Box avi_box; Widgets.EmojiLabel emoji_label; diff --git a/src/Widgets/Status.vala b/src/Widgets/Status.vala index 04b49dfe3..8a4b536d2 100644 --- a/src/Widgets/Status.vala +++ b/src/Widgets/Status.vala @@ -163,13 +163,6 @@ Tuba.toggle_css (this, settings.scale_emoji_hover, "lww-scale-emoji-hover"); } - static construct { - typeof (Widgets.Avatar).ensure (); - typeof (Widgets.RichLabel).ensure (); - typeof (Widgets.MarkupView).ensure (); - typeof (Widgets.FadeBin).ensure (); - } - private void update_collapse () { fade_bin.reveal = !settings.collapse_long_posts || expanded || enable_thread_lines; } From 04eecc8dafd4ab81c55571ed70789e4858686a6b Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Tue, 20 May 2025 10:20:44 +0300 Subject: [PATCH 2/2] fix(streams): build with newer Vala See https://gitlab.gnome.org/GNOME/vala/-/commit/7d405900242ff5ef96abe7b117ec4e65dc058858 Signed-off-by: Sergey Bugaev --- src/Services/Network/Streamable.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/Network/Streamable.vala b/src/Services/Network/Streamable.vala index 4113c3b75..be445a937 100644 --- a/src/Services/Network/Streamable.vala +++ b/src/Services/Network/Streamable.vala @@ -1,4 +1,4 @@ -public abstract interface Tuba.Streamable : Object { +public interface Tuba.Streamable : Object { public struct Event { public string type;