summaryrefslogtreecommitdiff
path: root/games-arcade/gnome-nibbles/files/gnome-nibbles-3.38.2-vala-0.50.4-GtkChild-2.patch
blob: 48c565303196852daf1e4aa81d90038033fcfe98 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
From 62964e9256fcac616109af874dbb2bd8342a9853 Mon Sep 17 00:00:00 2001
From: Rico Tzschichholz <ricotz@ubuntu.com>
Date: Wed, 17 Mar 2021 11:25:05 +0100
Subject: [PATCH] Reference of [GtkChild] fields is handled by GtkBuilder, type
 must be unowned

---
 src/controls.vala           | 20 ++++++++++----------
 src/nibbles-window.vala     | 26 +++++++++++++-------------
 src/players.vala            |  6 +++---
 src/preferences-dialog.vala | 30 +++++++++++++++---------------
 src/scoreboard.vala         |  6 +++---
 5 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/src/controls.vala b/src/controls.vala
index 584c9ff..f95d210 100644
--- a/src/controls.vala
+++ b/src/controls.vala
@@ -22,7 +22,7 @@ using Gtk;
 [GtkTemplate (ui = "/org/gnome/Nibbles/ui/controls.ui")]
 private class Controls : Box
 {
-    [GtkChild] private Box grids_box;
+    [GtkChild] private unowned Box grids_box;
     private Gee.LinkedList<ControlsGrid> grids = new Gee.LinkedList<ControlsGrid> ();
 
     private Gdk.Pixbuf arrow_pixbuf;
@@ -100,15 +100,15 @@ private class Controls : Box
 [GtkTemplate (ui = "/org/gnome/Nibbles/ui/controls-grid.ui")]
 private class ControlsGrid : Button
 {
-    [GtkChild] private Label name_label;
-    [GtkChild] private Image arrow_up;
-    [GtkChild] private Image arrow_down;
-    [GtkChild] private Image arrow_left;
-    [GtkChild] private Image arrow_right;
-    [GtkChild] private Label move_up_label;
-    [GtkChild] private Label move_down_label;
-    [GtkChild] private Label move_left_label;
-    [GtkChild] private Label move_right_label;
+    [GtkChild] private unowned Label name_label;
+    [GtkChild] private unowned Image arrow_up;
+    [GtkChild] private unowned Image arrow_down;
+    [GtkChild] private unowned Image arrow_left;
+    [GtkChild] private unowned Image arrow_right;
+    [GtkChild] private unowned Label move_up_label;
+    [GtkChild] private unowned Label move_down_label;
+    [GtkChild] private unowned Label move_left_label;
+    [GtkChild] private unowned Label move_right_label;
 
     internal WormProperties worm_props;
     internal ulong external_handler;
diff --git a/src/nibbles-window.vala b/src/nibbles-window.vala
index 6961326..6bfb74a 100644
--- a/src/nibbles-window.vala
+++ b/src/nibbles-window.vala
@@ -40,30 +40,30 @@ private class NibblesWindow : ApplicationWindow
     private int window_height;
 
     /* Main widgets */
-    [GtkChild] private Stack main_stack;
-    [GtkChild] private Overlay overlay;
+    [GtkChild] private unowned Stack main_stack;
+    [GtkChild] private unowned Overlay overlay;
 
     /* HeaderBar */
-    [GtkChild] private HeaderBar headerbar;
-    [GtkChild] private MenuButton hamburger_menu;
-    [GtkChild] private Button new_game_button;
-    [GtkChild] private Button pause_button;
+    [GtkChild] private unowned HeaderBar headerbar;
+    [GtkChild] private unowned MenuButton hamburger_menu;
+    [GtkChild] private unowned Button new_game_button;
+    [GtkChild] private unowned Button pause_button;
 
     /* Pre-game screen widgets */
-    [GtkChild] private Players players;
-    [GtkChild] private Speed speed;
-    [GtkChild] private Controls controls;
+    [GtkChild] private unowned Players players;
+    [GtkChild] private unowned Speed speed;
+    [GtkChild] private unowned Controls controls;
 
     /* Statusbar widgets */
-    [GtkChild] private Stack statusbar_stack;
-    [GtkChild] private Label countdown;
-    [GtkChild] private Scoreboard scoreboard;
+    [GtkChild] private unowned Stack statusbar_stack;
+    [GtkChild] private unowned Label countdown;
+    [GtkChild] private unowned Scoreboard scoreboard;
     private Gdk.Pixbuf scoreboard_life;
 
     /* Rendering of the game */
     private NibblesView? view;
 
-    [GtkChild] private Box game_box;
+    [GtkChild] private unowned Box game_box;
     private Games.GridFrame frame;
 
     /* Game being played */
diff --git a/src/players.vala b/src/players.vala
index 9198412..4bde18e 100644
--- a/src/players.vala
+++ b/src/players.vala
@@ -21,9 +21,9 @@ using Gtk;
 [GtkTemplate (ui = "/org/gnome/Nibbles/ui/players.ui")]
 private class Players : Box
 {
-    [GtkChild] private ToggleButton worms4;
-    [GtkChild] private ToggleButton worms5;
-    [GtkChild] private ToggleButton worms6;
+    [GtkChild] private unowned ToggleButton worms4;
+    [GtkChild] private unowned ToggleButton worms5;
+    [GtkChild] private unowned ToggleButton worms6;
 
     private SimpleAction nibbles_number_action;
     private SimpleAction players_number_action;
diff --git a/src/preferences-dialog.vala b/src/preferences-dialog.vala
index 216a1e2..2d3a7bf 100644
--- a/src/preferences-dialog.vala
+++ b/src/preferences-dialog.vala
@@ -24,21 +24,21 @@ private class PreferencesDialog : Window
     private GLib.Settings settings;
     private Gee.ArrayList<GLib.Settings> worm_settings;
 
-    [GtkChild] private Stack            stack;
-    [GtkChild] private Stack            headerbar_stack;
-    [GtkChild] private ComboBoxText     worm_combobox;
-    [GtkChild] private Gtk.ListStore    list_store_1;
-    [GtkChild] private Gtk.ListStore    list_store_2;
-    [GtkChild] private Gtk.ListStore    list_store_3;
-    [GtkChild] private Gtk.ListStore    list_store_4;
-    [GtkChild] private TreeView         tree_view_1;
-    [GtkChild] private TreeView         tree_view_2;
-    [GtkChild] private TreeView         tree_view_3;
-    [GtkChild] private TreeView         tree_view_4;
-    [GtkChild] private ComboBoxText     combo_box_1;
-    [GtkChild] private ComboBoxText     combo_box_2;
-    [GtkChild] private ComboBoxText     combo_box_3;
-    [GtkChild] private ComboBoxText     combo_box_4;
+    [GtkChild] private unowned Stack            stack;
+    [GtkChild] private unowned Stack            headerbar_stack;
+    [GtkChild] private unowned ComboBoxText     worm_combobox;
+    [GtkChild] private unowned Gtk.ListStore    list_store_1;
+    [GtkChild] private unowned Gtk.ListStore    list_store_2;
+    [GtkChild] private unowned Gtk.ListStore    list_store_3;
+    [GtkChild] private unowned Gtk.ListStore    list_store_4;
+    [GtkChild] private unowned TreeView         tree_view_1;
+    [GtkChild] private unowned TreeView         tree_view_2;
+    [GtkChild] private unowned TreeView         tree_view_3;
+    [GtkChild] private unowned TreeView         tree_view_4;
+    [GtkChild] private unowned ComboBoxText     combo_box_1;
+    [GtkChild] private unowned ComboBoxText     combo_box_2;
+    [GtkChild] private unowned ComboBoxText     combo_box_3;
+    [GtkChild] private unowned ComboBoxText     combo_box_4;
 
     private Gee.ArrayList<Gtk.ListStore>    list_stores;
     private Gee.ArrayList<TreeView>         tree_views;
diff --git a/src/scoreboard.vala b/src/scoreboard.vala
index a41aee1..aebc1cc 100644
--- a/src/scoreboard.vala
+++ b/src/scoreboard.vala
@@ -59,9 +59,9 @@ private class Scoreboard : Box
 [GtkTemplate (ui = "/org/gnome/Nibbles/ui/player-score-box.ui")]
 private class PlayerScoreBox : Box
 {
-    [GtkChild] private Label name_label;
-    [GtkChild] private Label score_label;
-    [GtkChild] private Grid lives_grid;
+    [GtkChild] private unowned Label name_label;
+    [GtkChild] private unowned Label score_label;
+    [GtkChild] private unowned Grid lives_grid;
 
     private Gee.LinkedList<Image> life_images = new Gee.LinkedList<Image> ();
 
-- 
GitLab