From 696327a4d5f36fe7ccd69af8f2b9034009c70be2 Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Thu, 2 Jan 2025 10:51:32 +0000 Subject: [PATCH] Remove unnecessary cast --- src/MainWindow.vala | 2 +- src/Widgets/TerminalView.vala | 2 +- src/tests/Application.vala | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 6b1983ae48..ca2a93e2c2 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -999,7 +999,7 @@ namespace Terminal { var pos = notebook.tab_menu_target != null ? notebook.tab_view.get_page_position (notebook.tab_menu_target) + 1 : - (int)notebook.n_pages; + notebook.n_pages; new_tab (term.get_shell_location (), null, true, pos); } diff --git a/src/Widgets/TerminalView.vala b/src/Widgets/TerminalView.vala index 85fabdd858..e9e8c3be22 100644 --- a/src/Widgets/TerminalView.vala +++ b/src/Widgets/TerminalView.vala @@ -13,7 +13,7 @@ public class Terminal.TerminalView : Gtk.Box { public signal void new_tab_requested (); public signal void tab_duplicated (Hdy.TabPage page); - public uint n_pages { + public int n_pages { get { return tab_view.n_pages; } diff --git a/src/tests/Application.vala b/src/tests/Application.vala index 0e5415b6b7..05dfad9da7 100644 --- a/src/tests/Application.vala +++ b/src/tests/Application.vala @@ -145,14 +145,14 @@ namespace Terminal.Test.Application { option ("{'new-tab':}", "@a{sv} {}", () => { unowned var window = (MainWindow) application.active_window; assert_nonnull (window); - var n_tabs = (int) window.notebook.n_pages; + var n_tabs = window.notebook.n_pages; assert_cmpint (n_tabs, CompareOperator.EQ, 2); }); option ("{'new-tab':}", "@a{sv} {}", () => { unowned var window = (MainWindow) application.active_window; assert_nonnull (window); - var n_tabs = (int) window.notebook.n_pages; + var n_tabs = window.notebook.n_pages; assert_cmpint (n_tabs, CompareOperator.EQ, 1); }); }); @@ -176,7 +176,7 @@ namespace Terminal.Test.Application { option ("{'execute':<[b'%s']>}".printf (string.joinv ("',b'", execute)), "@a{sv} {}", () => { unowned var window = (MainWindow) application.active_window; assert_nonnull (window); - var n_tabs = (int) window.notebook.n_pages; + var n_tabs = window.notebook.n_pages; assert_cmpint (n_tabs, CompareOperator.EQ, 5); // include the guaranted extra tab }); @@ -184,7 +184,7 @@ namespace Terminal.Test.Application { option ("{'execute':<[b'',b'',b'']>}", "@a{sv} {}", () => { unowned var window = (MainWindow) application.active_window; assert_nonnull (window); - var n_tabs = (int) window.notebook.n_pages; + var n_tabs = window.notebook.n_pages; assert_cmpint (n_tabs, CompareOperator.EQ, 1); }); });