[gnome-sudoku/ricotz/vala] Reference of [GtkChild] fields is handled by GtkBuilder, type must be unowned




commit a31c873921631c5ec55b7599994b7beff2091eee
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Mar 17 11:28:13 2021 +0100

    Reference of [GtkChild] fields is handled by GtkBuilder, type must be unowned

 src/print-dialog.vala  | 16 ++++++++--------
 src/sudoku-window.vala | 24 ++++++++++++------------
 2 files changed, 20 insertions(+), 20 deletions(-)
---
diff --git a/src/print-dialog.vala b/src/print-dialog.vala
index 1a696fe..340b68f 100644
--- a/src/print-dialog.vala
+++ b/src/print-dialog.vala
@@ -27,14 +27,14 @@ public class PrintDialog : Dialog
     private SudokuSaver saver;
     private GLib.Settings settings;
 
-    [GtkChild] private Button print_button;
-    [GtkChild] private Grid print_grid;
-    [GtkChild] private SpinButton n_sudokus_button;
-    [GtkChild] private SpinButton n_sudokus_per_page_button;
-    [GtkChild] private RadioButton easy_radio_button;
-    [GtkChild] private RadioButton medium_radio_button;
-    [GtkChild] private RadioButton hard_radio_button;
-    [GtkChild] private RadioButton very_hard_radio_button;
+    [GtkChild] private unowned Button print_button;
+    [GtkChild] private unowned Grid print_grid;
+    [GtkChild] private unowned SpinButton n_sudokus_button;
+    [GtkChild] private unowned SpinButton n_sudokus_per_page_button;
+    [GtkChild] private unowned RadioButton easy_radio_button;
+    [GtkChild] private unowned RadioButton medium_radio_button;
+    [GtkChild] private unowned RadioButton hard_radio_button;
+    [GtkChild] private unowned RadioButton very_hard_radio_button;
 
     private Revealer revealer;
     private Spinner spinner;
diff --git a/src/sudoku-window.vala b/src/sudoku-window.vala
index 93d715c..8b4df22 100644
--- a/src/sudoku-window.vala
+++ b/src/sudoku-window.vala
@@ -24,21 +24,21 @@ using Gtk;
 [GtkTemplate (ui = "/org/gnome/Sudoku/ui/sudoku-window.ui")]
 public class SudokuWindow : ApplicationWindow
 {
-    [GtkChild] private HeaderBar headerbar;
-    [GtkChild] private Box start_box;
-    [GtkChild] private Frame frame;
-    [GtkChild] private Box game_box; // Holds the view
+    [GtkChild] private unowned HeaderBar headerbar;
+    [GtkChild] private unowned Box start_box;
+    [GtkChild] private unowned Frame frame;
+    [GtkChild] private unowned Box game_box; // Holds the view
 
-    [GtkChild] private Box undo_redo_box;
-    [GtkChild] private Button back_button;
+    [GtkChild] private unowned Box undo_redo_box;
+    [GtkChild] private unowned Button back_button;
 
-    [GtkChild] private Box clock_box;
-    [GtkChild] private Label clock_label;
-    [GtkChild] private Image clock_image;
+    [GtkChild] private unowned Box clock_box;
+    [GtkChild] private unowned Label clock_label;
+    [GtkChild] private unowned Image clock_image;
 
-    [GtkChild] private Button play_custom_game_button;
-    [GtkChild] private Button play_pause_button;
-    [GtkChild] private Image play_pause_image;
+    [GtkChild] private unowned Button play_custom_game_button;
+    [GtkChild] private unowned Button play_pause_button;
+    [GtkChild] private unowned Image play_pause_image;
 
     private bool window_is_maximized;
     private bool window_is_fullscreen;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]