[gnome-calculator] Declare all GtkChild widgets as unowned



commit 2f89d9f7d27e5eb830ec14fd5141dd0bff23f33f
Author: joshas <joshas gmail com>
Date:   Thu Feb 18 22:17:54 2021 +0200

    Declare all GtkChild widgets as unowned

 src/math-converter.vala        | 10 +++++-----
 src/math-function-popover.vala |  8 ++++----
 src/math-history.vala          |  6 +++---
 src/math-preferences.vala      | 12 ++++++------
 src/math-variable-popover.vala |  6 +++---
 src/math-window.vala           |  8 ++++----
 6 files changed, 25 insertions(+), 25 deletions(-)
---
diff --git a/src/math-converter.vala b/src/math-converter.vala
index bc03b4de..755e1d0e 100644
--- a/src/math-converter.vala
+++ b/src/math-converter.vala
@@ -16,16 +16,16 @@ public class MathConverter : Gtk.Grid
     private string category;
 
     [GtkChild]
-    private Gtk.CellRendererText from_renderer;
+    private unowned Gtk.CellRendererText from_renderer;
 
     [GtkChild]
-    private Gtk.ComboBox from_combo;
+    private unowned Gtk.ComboBox from_combo;
     [GtkChild]
-    private Gtk.ComboBox to_combo;
+    private unowned Gtk.ComboBox to_combo;
     [GtkChild]
-    private Gtk.Label from_label;
+    private unowned Gtk.Label from_label;
     [GtkChild]
-    private Gtk.Label to_label;
+    private unowned Gtk.Label to_label;
 
     public signal void changed ();
 
diff --git a/src/math-function-popover.vala b/src/math-function-popover.vala
index f2d1ea09..159f99c2 100644
--- a/src/math-function-popover.vala
+++ b/src/math-function-popover.vala
@@ -17,16 +17,16 @@ public class MathFunctionPopover : Gtk.Popover
     private MathEquation equation;
 
     [GtkChild]
-    private Gtk.ListBox function_list;
+    private unowned Gtk.ListBox function_list;
 
     [GtkChild]
-    private Gtk.Entry function_name_entry;
+    private unowned Gtk.Entry function_name_entry;
     private bool function_name_entry_placeholder_reseted = false;
 
     [GtkChild]
-    private Gtk.Button add_function_button;
+    private unowned Gtk.Button add_function_button;
     [GtkChild]
-    private Gtk.SpinButton add_arguments_button;
+    private unowned Gtk.SpinButton add_arguments_button;
 
     public MathFunctionPopover (MathEquation equation)
     {
diff --git a/src/math-history.vala b/src/math-history.vala
index 5331217d..31627e71 100644
--- a/src/math-history.vala
+++ b/src/math-history.vala
@@ -14,7 +14,7 @@ public class HistoryView : Gtk.ScrolledWindow
     string? last_equation = null;
 
     [GtkChild]
-    Gtk.ListBox listbox;
+    unowned Gtk.ListBox listbox;
 
     private int _rows = 0;
     private Serializer serializer;
@@ -82,9 +82,9 @@ public class HistoryView : Gtk.ScrolledWindow
 public class HistoryEntry : Gtk.ListBoxRow
 {
     [GtkChild]
-    Gtk.Label equation_label;
+    unowned Gtk.Label equation_label;
     [GtkChild]
-    public Gtk.Label answer_label;
+    public unowned Gtk.Label answer_label;
 
     private Number number;
 
diff --git a/src/math-preferences.vala b/src/math-preferences.vala
index 8c64a48a..bc8704f2 100644
--- a/src/math-preferences.vala
+++ b/src/math-preferences.vala
@@ -13,17 +13,17 @@ public class MathPreferencesDialog : Gtk.Dialog
     public MathEquation equation { private get; construct; }
 
     [GtkChild]
-    private Gtk.ComboBoxText combo_angle_units;
+    private unowned Gtk.ComboBoxText combo_angle_units;
     [GtkChild]
-    private Gtk.ComboBoxText combo_refresh_interval;
+    private unowned Gtk.ComboBoxText combo_refresh_interval;
     [GtkChild]
-    private Gtk.ComboBoxText combo_word_size;
+    private unowned Gtk.ComboBoxText combo_word_size;
     [GtkChild]
-    private Gtk.SpinButton spinbutton_decimals;
+    private unowned Gtk.SpinButton spinbutton_decimals;
     [GtkChild]
-    private Gtk.Switch switch_thousands_separators;
+    private unowned Gtk.Switch switch_thousands_separators;
     [GtkChild]
-    private Gtk.Switch switch_trailing_zeroes;
+    private unowned Gtk.Switch switch_trailing_zeroes;
 
     private Settings settings;
 
diff --git a/src/math-variable-popover.vala b/src/math-variable-popover.vala
index 9677f108..a6c67981 100644
--- a/src/math-variable-popover.vala
+++ b/src/math-variable-popover.vala
@@ -16,11 +16,11 @@ public class MathVariablePopover : Gtk.Popover
     private MathEquation equation;
 
     [GtkChild]
-    private Gtk.ListBox variable_list;
+    private unowned Gtk.ListBox variable_list;
     [GtkChild]
-    private Gtk.Entry variable_name_entry;
+    private unowned Gtk.Entry variable_name_entry;
     [GtkChild]
-    private Gtk.Button store_variable_button;
+    private unowned Gtk.Button store_variable_button;
 
     public MathVariablePopover (MathEquation equation)
     {
diff --git a/src/math-window.vala b/src/math-window.vala
index b50c6e41..8dd0d728 100644
--- a/src/math-window.vala
+++ b/src/math-window.vala
@@ -23,13 +23,13 @@ public class MathWindow : Hdy.ApplicationWindow
     private bool remove_buttons;
 
     [GtkChild]
-    private Gtk.MenuButton menu_button;
+    private unowned Gtk.MenuButton menu_button;
     [GtkChild]
-    private Gtk.Label mode_label;
+    private unowned Gtk.Label mode_label;
     [GtkChild]
-    private Gtk.Grid grid;
+    private unowned Gtk.Grid grid;
     [GtkChild]
-    private MathConverter converter;
+    private unowned MathConverter converter;
 
     private const ActionEntry[] window_entries =
     {


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