[gnome-clocks] Declare [GtkChild] fields as 'unowned'
- From: Bilal Elmoussaoui <bilelmoussaoui src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks] Declare [GtkChild] fields as 'unowned'
- Date: Thu, 28 Jan 2021 18:31:42 +0000 (UTC)
commit ee863d0d3f58195b1f5fbcc1004ebf322f780c26
Author: Yetizone <andreii lisita gmail com>
Date: Wed Jan 20 22:54:27 2021 +0200
Declare [GtkChild] fields as 'unowned'
Fixes build warnings
See https://gitlab.gnome.org/GNOME/vala/-/issues/1121
src/alarm-day-picker-row.vala | 2 +-
src/alarm-face.vala | 6 +++---
src/alarm-ringing-panel.vala | 8 ++++----
src/alarm-row.vala | 12 ++++++------
src/alarm-setup-dialog.vala | 20 ++++++++++----------
src/header-bar.vala | 4 ++--
src/stopwatch-face.vala | 20 ++++++++++----------
src/stopwatch-laps-row.vala | 6 +++---
src/timer-face.vala | 6 +++---
src/timer-row.vala | 16 ++++++++--------
src/timer-setup.vala | 6 +++---
src/window.vala | 22 +++++++++++-----------
src/world-face.vala | 6 +++---
src/world-location-dialog.vala | 10 +++++-----
src/world-row.vala | 12 ++++++------
src/world-standalone.vala | 8 ++++----
16 files changed, 82 insertions(+), 82 deletions(-)
---
diff --git a/src/alarm-day-picker-row.vala b/src/alarm-day-picker-row.vala
index 1fa93fa..398d42f 100644
--- a/src/alarm-day-picker-row.vala
+++ b/src/alarm-day-picker-row.vala
@@ -104,7 +104,7 @@ public class DayPickerRow : Hdy.ActionRow {
private Utils.Weekdays days = new Utils.Weekdays ();
[GtkChild]
- private Gtk.FlowBox flow;
+ private unowned Gtk.FlowBox flow;
construct {
// Create actions to control propeties from menu items
diff --git a/src/alarm-face.vala b/src/alarm-face.vala
index 6000739..0fe77cb 100644
--- a/src/alarm-face.vala
+++ b/src/alarm-face.vala
@@ -30,11 +30,11 @@ public class Face : Gtk.Stack, Clocks.Clock {
private ContentStore alarms;
private GLib.Settings settings;
[GtkChild]
- private Gtk.Widget empty_view;
+ private unowned Gtk.Widget empty_view;
[GtkChild]
- private Gtk.ListBox listbox;
+ private unowned Gtk.ListBox listbox;
[GtkChild]
- private Gtk.ScrolledWindow list_view;
+ private unowned Gtk.ScrolledWindow list_view;
construct {
panel_id = ALARM;
diff --git a/src/alarm-ringing-panel.vala b/src/alarm-ringing-panel.vala
index 820a5bb..29f4075 100644
--- a/src/alarm-ringing-panel.vala
+++ b/src/alarm-ringing-panel.vala
@@ -54,13 +54,13 @@ private class RingingPanel : Gtk.Bin {
private Item? _alarm;
private ulong alarm_state_handler;
[GtkChild]
- private Gtk.Label title_label;
+ private unowned Gtk.Label title_label;
[GtkChild]
- private Gtk.Label time_label;
+ private unowned Gtk.Label time_label;
[GtkChild]
- private Gtk.Button stop_button;
+ private unowned Gtk.Button stop_button;
[GtkChild]
- private Gtk.Button snooze_button;
+ private unowned Gtk.Button snooze_button;
construct {
// Start ticking...
diff --git a/src/alarm-row.vala b/src/alarm-row.vala
index c30c6a5..927886f 100644
--- a/src/alarm-row.vala
+++ b/src/alarm-row.vala
@@ -26,17 +26,17 @@ private class Row : Gtk.ListBoxRow {
public Face face { get; construct set; }
[GtkChild]
- private Gtk.Switch toggle;
+ private unowned Gtk.Switch toggle;
[GtkChild]
- private Gtk.Label title;
+ private unowned Gtk.Label title;
[GtkChild]
- private Gtk.Revealer title_reveal;
+ private unowned Gtk.Revealer title_reveal;
[GtkChild]
- private Gtk.Label time;
+ private unowned Gtk.Label time;
[GtkChild]
- private Gtk.Label repeats;
+ private unowned Gtk.Label repeats;
[GtkChild]
- private Gtk.Revealer repeats_reveal;
+ private unowned Gtk.Revealer repeats_reveal;
public Row (Item alarm, Face face) {
Object (alarm: alarm, face: face);
diff --git a/src/alarm-setup-dialog.vala b/src/alarm-setup-dialog.vala
index 75d6baa..97cde1f 100644
--- a/src/alarm-setup-dialog.vala
+++ b/src/alarm-setup-dialog.vala
@@ -76,26 +76,26 @@ private class DurationModel : ListModel, Object {
private class SetupDialog : Gtk.Dialog {
private Utils.WallClock.Format format;
[GtkChild]
- private Gtk.Grid time_grid;
+ private unowned Gtk.Grid time_grid;
[GtkChild]
- private Gtk.SpinButton h_spinbutton;
+ private unowned Gtk.SpinButton h_spinbutton;
[GtkChild]
- private Gtk.SpinButton m_spinbutton;
+ private unowned Gtk.SpinButton m_spinbutton;
[GtkChild]
- private Gtk.Entry name_entry;
+ private unowned Gtk.Entry name_entry;
[GtkChild]
- private Hdy.ComboRow snooze_duration;
+ private unowned Hdy.ComboRow snooze_duration;
[GtkChild]
- private Hdy.ComboRow ring_duration;
+ private unowned Hdy.ComboRow ring_duration;
private AmPmToggleButton am_pm_button;
[GtkChild]
- private DayPickerRow repeats;
+ private unowned DayPickerRow repeats;
[GtkChild]
- private Gtk.Stack am_pm_stack;
+ private unowned Gtk.Stack am_pm_stack;
[GtkChild]
- private Gtk.Revealer label_revealer;
+ private unowned Gtk.Revealer label_revealer;
[GtkChild]
- private Gtk.Button delete_button;
+ private unowned Gtk.Button delete_button;
private List<Item> other_alarms;
private DurationModel duration_model;
diff --git a/src/header-bar.vala b/src/header-bar.vala
index 09bf9bf..56096d5 100644
--- a/src/header-bar.vala
+++ b/src/header-bar.vala
@@ -51,9 +51,9 @@ public class Clocks.HeaderBar : Hdy.HeaderBar {
private ButtonMode _button_mode;
[GtkChild]
- private Gtk.Stack start_button_stack;
+ private unowned Gtk.Stack start_button_stack;
[GtkChild]
- private Hdy.ViewSwitcherTitle view_switcher_title;
+ private unowned Hdy.ViewSwitcherTitle view_switcher_title;
[GtkCallback]
private void title_visible_changed () {
diff --git a/src/stopwatch-face.vala b/src/stopwatch-face.vala
index 69199d9..10fcc6a 100644
--- a/src/stopwatch-face.vala
+++ b/src/stopwatch-face.vala
@@ -54,28 +54,28 @@ public class Face : Gtk.Box, Clocks.Clock {
private int current_lap;
[GtkChild]
- private Gtk.Label hours_label;
+ private unowned Gtk.Label hours_label;
[GtkChild]
- private Gtk.Label minutes_label;
+ private unowned Gtk.Label minutes_label;
[GtkChild]
- private Gtk.Label seconds_label;
+ private unowned Gtk.Label seconds_label;
[GtkChild]
- private Gtk.Label miliseconds_label;
+ private unowned Gtk.Label miliseconds_label;
[GtkChild]
- private Gtk.Box time_container;
+ private unowned Gtk.Box time_container;
[GtkChild]
- private Gtk.Revealer laps_revealer;
+ private unowned Gtk.Revealer laps_revealer;
[GtkChild]
- private Gtk.Box container;
+ private unowned Gtk.Box container;
[GtkChild]
- private Gtk.Button start_btn;
+ private unowned Gtk.Button start_btn;
[GtkChild]
- private Gtk.Button clear_btn;
+ private unowned Gtk.Button clear_btn;
[GtkChild]
- private Gtk.ListBox laps_list;
+ private unowned Gtk.ListBox laps_list;
construct {
panel_id = STOPWATCH;
diff --git a/src/stopwatch-laps-row.vala b/src/stopwatch-laps-row.vala
index 60f6d43..c5c7a73 100644
--- a/src/stopwatch-laps-row.vala
+++ b/src/stopwatch-laps-row.vala
@@ -33,11 +33,11 @@ private string render_duration (double duration) {
[GtkTemplate (ui = "/org/gnome/clocks/ui/stopwatch-laps-row.ui")]
private class LapsRow : Gtk.ListBoxRow {
[GtkChild]
- private Gtk.Label index_label;
+ private unowned Gtk.Label index_label;
[GtkChild]
- private Gtk.Label difference_label;
+ private unowned Gtk.Label difference_label;
[GtkChild]
- private Gtk.Label duration_label;
+ private unowned Gtk.Label duration_label;
private Lap current;
private Lap? before;
diff --git a/src/timer-face.vala b/src/timer-face.vala
index 95aac80..26f9e29 100644
--- a/src/timer-face.vala
+++ b/src/timer-face.vala
@@ -24,11 +24,11 @@ namespace Timer {
public class Face : Gtk.Stack, Clocks.Clock {
private Setup timer_setup;
[GtkChild]
- private Gtk.ListBox timers_list;
+ private unowned Gtk.ListBox timers_list;
[GtkChild]
- private Gtk.Box no_timer_container;
+ private unowned Gtk.Box no_timer_container;
[GtkChild]
- private Gtk.Button start_button;
+ private unowned Gtk.Button start_button;
public PanelId panel_id { get; construct set; }
public ButtonMode button_mode { get; set; default = NONE; }
diff --git a/src/timer-row.vala b/src/timer-row.vala
index d26ebce..76e6ad5 100644
--- a/src/timer-row.vala
+++ b/src/timer-row.vala
@@ -42,25 +42,25 @@ public class Row : Gtk.ListBoxRow {
[GtkChild]
- private Gtk.Label countdown_label;
+ private unowned Gtk.Label countdown_label;
[GtkChild]
- private Gtk.Label timer_name;
+ private unowned Gtk.Label timer_name;
[GtkChild]
- private Gtk.Stack name_stack;
+ private unowned Gtk.Stack name_stack;
[GtkChild]
- private Gtk.Stack start_stack;
+ private unowned Gtk.Stack start_stack;
[GtkChild]
- private Gtk.Stack reset_stack;
+ private unowned Gtk.Stack reset_stack;
[GtkChild]
- private Gtk.Stack delete_stack;
+ private unowned Gtk.Stack delete_stack;
[GtkChild]
- private Gtk.Button delete_button;
+ private unowned Gtk.Button delete_button;
[GtkChild]
- private Gtk.Entry title;
+ private unowned Gtk.Entry title;
public signal void deleted ();
public signal void edited ();
diff --git a/src/timer-setup.vala b/src/timer-setup.vala
index 3661378..651f405 100644
--- a/src/timer-setup.vala
+++ b/src/timer-setup.vala
@@ -24,11 +24,11 @@ namespace Timer {
public class Setup : Gtk.Box {
public signal void duration_changed (int seconds);
[GtkChild]
- private Gtk.SpinButton h_spinbutton;
+ private unowned Gtk.SpinButton h_spinbutton;
[GtkChild]
- private Gtk.SpinButton m_spinbutton;
+ private unowned Gtk.SpinButton m_spinbutton;
[GtkChild]
- private Gtk.SpinButton s_spinbutton;
+ private unowned Gtk.SpinButton s_spinbutton;
public Setup () {
var actions = new SimpleActionGroup ();
diff --git a/src/window.vala b/src/window.vala
index 9bc57b0..55c7f2e 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -30,27 +30,27 @@ public class Window : Hdy.ApplicationWindow {
};
[GtkChild]
- private HeaderBar header_bar;
+ private unowned HeaderBar header_bar;
[GtkChild]
- private Hdy.Deck alarm_deck;
+ private unowned Hdy.Deck alarm_deck;
[GtkChild]
- private Hdy.Deck world_deck;
+ private unowned Hdy.Deck world_deck;
[GtkChild]
- private Gtk.Box main_view;
+ private unowned Gtk.Box main_view;
[GtkChild]
- private Gtk.Stack stack;
+ private unowned Gtk.Stack stack;
[GtkChild]
- private World.Face world;
+ private unowned World.Face world;
[GtkChild]
- private Alarm.Face alarm;
+ private unowned Alarm.Face alarm;
[GtkChild]
- private World.Standalone world_standalone;
+ private unowned World.Standalone world_standalone;
[GtkChild]
- private Alarm.RingingPanel alarm_ringing_panel;
+ private unowned Alarm.RingingPanel alarm_ringing_panel;
[GtkChild]
- private Stopwatch.Face stopwatch;
+ private unowned Stopwatch.Face stopwatch;
[GtkChild]
- private Timer.Face timer;
+ private unowned Timer.Face timer;
private GLib.Settings settings;
diff --git a/src/world-face.vala b/src/world-face.vala
index 30f8cba..501d502 100644
--- a/src/world-face.vala
+++ b/src/world-face.vala
@@ -31,11 +31,11 @@ public class Face : Gtk.Stack, Clocks.Clock {
private ContentStore locations;
private GLib.Settings settings;
[GtkChild]
- private Gtk.Widget empty_view;
+ private unowned Gtk.Widget empty_view;
[GtkChild]
- private Gtk.ScrolledWindow list_view;
+ private unowned Gtk.ScrolledWindow list_view;
[GtkChild]
- private Gtk.ListBox listbox;
+ private unowned Gtk.ListBox listbox;
construct {
panel_id = WORLD;
diff --git a/src/world-location-dialog.vala b/src/world-location-dialog.vala
index 3659984..86ca7cc 100644
--- a/src/world-location-dialog.vala
+++ b/src/world-location-dialog.vala
@@ -31,15 +31,15 @@ private class ClockLocation : Object {
[GtkTemplate (ui = "/org/gnome/clocks/ui/world-location-dialog.ui")]
private class LocationDialog : Gtk.Dialog {
[GtkChild]
- private Gtk.Stack stack;
+ private unowned Gtk.Stack stack;
[GtkChild]
- private Gtk.Box empty_search_box;
+ private unowned Gtk.Box empty_search_box;
[GtkChild]
- private Gtk.SearchEntry location_entry;
+ private unowned Gtk.SearchEntry location_entry;
[GtkChild]
- private Gtk.ListBox listbox;
+ private unowned Gtk.ListBox listbox;
[GtkChild]
- private Gtk.Button button_add;
+ private unowned Gtk.Button button_add;
private Face world;
private ListStore locations;
diff --git a/src/world-row.vala b/src/world-row.vala
index c0ed307..5994702 100644
--- a/src/world-row.vala
+++ b/src/world-row.vala
@@ -24,17 +24,17 @@ private class Row : Gtk.ListBoxRow {
public Item location { get; construct set; }
[GtkChild]
- private Gtk.Label time_label;
+ private unowned Gtk.Label time_label;
[GtkChild]
- private Gtk.Widget name_label;
+ private unowned Gtk.Widget name_label;
[GtkChild]
- private Gtk.Label desc;
+ private unowned Gtk.Label desc;
[GtkChild]
- private Gtk.Stack delete_stack;
+ private unowned Gtk.Stack delete_stack;
[GtkChild]
- private Gtk.Widget delete_button;
+ private unowned Gtk.Widget delete_button;
[GtkChild]
- private Gtk.Widget delete_empty;
+ private unowned Gtk.Widget delete_empty;
internal signal void remove_clock ();
diff --git a/src/world-standalone.vala b/src/world-standalone.vala
index 1ff33b6..40557f4 100644
--- a/src/world-standalone.vala
+++ b/src/world-standalone.vala
@@ -26,13 +26,13 @@ public class Standalone : Gtk.Box {
public Item? location { get; set; }
[GtkChild]
- private Gtk.Label time_label;
+ private unowned Gtk.Label time_label;
[GtkChild]
- private Gtk.Label day_label;
+ private unowned Gtk.Label day_label;
[GtkChild]
- private Gtk.Label sunrise_label;
+ private unowned Gtk.Label sunrise_label;
[GtkChild]
- private Gtk.Label sunset_label;
+ private unowned Gtk.Label sunset_label;
construct {
// Start ticking...
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]