Skip to content

Commit

Permalink
Fix unowned GtkChild warning
Browse files Browse the repository at this point in the history
  • Loading branch information
benwaffle committed Feb 28, 2021
1 parent a88b3ee commit f48f87d
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 66 deletions.
2 changes: 1 addition & 1 deletion src/ErrorDialog.vala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[GtkTemplate (ui = "/org/vaccine/app/error-dialog.ui")]
class Vaccine.ErrorDialog : Gtk.Dialog {
[GtkChild] Gtk.Label label;
[GtkChild] unowned Gtk.Label label;

public ErrorDialog (string message) {
Object (use_header_bar: 1);
Expand Down
8 changes: 4 additions & 4 deletions src/view/CatalogItem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ public class Vaccine.CatalogItem : Gtk.Button {
// TODO: show # of replies (and make it look good)
private weak MainWindow main_window;

[GtkChild] private Gtk.Stack image_stack;
[GtkChild] private unowned Gtk.Stack image_stack;

[GtkChild] public Gtk.Label post_subject;
[GtkChild] public Gtk.Label post_comment;
[GtkChild] public Gtk.Label post_n_replies;
[GtkChild] public unowned Gtk.Label post_subject;
[GtkChild] public unowned Gtk.Label post_comment;
[GtkChild] public unowned Gtk.Label post_n_replies;

private Cancellable? cancel = null;

Expand Down
2 changes: 1 addition & 1 deletion src/view/CatalogWidget.vala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[GtkTemplate (ui = "/org/vaccine/app/catalog-widget.ui")]
public class Vaccine.CatalogWidget : Gtk.Box, NotebookPage {
[GtkChild] public Gtk.FlowBox layout;
[GtkChild] public unowned Gtk.FlowBox layout;

public string search_text { get; set; }

Expand Down
42 changes: 21 additions & 21 deletions src/view/MainWindow.vala
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
[GtkTemplate (ui = "/org/vaccine/app/main-window.ui")]
public class Vaccine.MainWindow : Gtk.ApplicationWindow {
[GtkChild] private Gtk.HeaderBar headerbar;
[GtkChild] private Gtk.SearchEntry searchentry;
[GtkChild] private unowned Gtk.HeaderBar headerbar;
[GtkChild] private unowned Gtk.SearchEntry searchentry;

[GtkChild] private Gtk.Button choose_board_button;
[GtkChild] private Gtk.MenuButton board_sort_button;
[GtkChild] private Gtk.ToggleButton show_search_bar_button;
[GtkChild] private Gtk.Button open_in_browser_button;
[GtkChild] private Gtk.Button refresh_button;
[GtkChild] private unowned Gtk.Button choose_board_button;
[GtkChild] private unowned Gtk.MenuButton board_sort_button;
[GtkChild] private unowned Gtk.ToggleButton show_search_bar_button;
[GtkChild] private unowned Gtk.Button open_in_browser_button;
[GtkChild] private unowned Gtk.Button refresh_button;

// fullscreen headerbar controls
[GtkChild] private Gtk.HeaderBar fs_headerbar;
[GtkChild] private Gtk.ToggleButton fs_choose_board_button;
[GtkChild] private Gtk.ToggleButton fs_show_search_bar_button;
[GtkChild] private Gtk.Button fs_open_in_browser_button;
[GtkChild] private Gtk.Button fs_refresh_button;
[GtkChild] private Gtk.Revealer fs_revealer;

[GtkChild] private Gtk.SearchBar searchbar;
[GtkChild] private Gtk.Stack content_stack;
[GtkChild] private Gtk.Notebook notebook;
[GtkChild] private Gtk.Label no_content_description;
[GtkChild] private unowned Gtk.HeaderBar fs_headerbar;
[GtkChild] private unowned Gtk.ToggleButton fs_choose_board_button;
[GtkChild] private unowned Gtk.ToggleButton fs_show_search_bar_button;
[GtkChild] private unowned Gtk.Button fs_open_in_browser_button;
[GtkChild] private unowned Gtk.Button fs_refresh_button;
[GtkChild] private unowned Gtk.Revealer fs_revealer;

[GtkChild] private unowned Gtk.SearchBar searchbar;
[GtkChild] private unowned Gtk.Stack content_stack;
[GtkChild] private unowned Gtk.Notebook notebook;
[GtkChild] private unowned Gtk.Label no_content_description;

// board chooser
[GtkChild] private Gtk.Popover popover;
[GtkChild] private Gtk.ListBox listbox;
[GtkChild] private Gtk.SearchEntry board_search;
[GtkChild] private unowned Gtk.Popover popover;
[GtkChild] private unowned Gtk.ListBox listbox;
[GtkChild] private unowned Gtk.SearchEntry board_search;

private CatalogWidget catalog;

Expand Down
28 changes: 14 additions & 14 deletions src/view/MediaView.vala
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
[GtkTemplate (ui = "/org/vaccine/app/media-view.ui")]
public class Vaccine.MediaView : Gtk.Window {
// [GtkChild] private Gtk.HeaderBar headerbar;
// [GtkChild] private unowned Gtk.HeaderBar headerbar;

// headerbar buttons
// [GtkChild] private Gtk.Button btn_prev;
// [GtkChild] private Gtk.Button btn_next;
[GtkChild] private Gtk.ToggleButton btn_gallery;
// [GtkChild] private Gtk.Button btn_download;
[GtkChild] private Gtk.Button btn_present;
[GtkChild] private Gtk.Button btn_reverse_search;
// [GtkChild] private unowned Gtk.Button btn_prev;
// [GtkChild] private unowned Gtk.Button btn_next;
[GtkChild] private unowned Gtk.ToggleButton btn_gallery;
// [GtkChild] private unowned Gtk.Button btn_download;
[GtkChild] private unowned Gtk.Button btn_present;
[GtkChild] private unowned Gtk.Button btn_reverse_search;

// view and containers
[GtkChild] private Gtk.Stack stack;
[GtkChild] private Gtk.Alignment loading_view;
[GtkChild] private Gtk.ProgressBar download_progress;
[GtkChild] private Gtk.Box gallery_view;
[GtkChild] private Gtk.IconView gallery_icons;
[GtkChild] private unowned Gtk.Stack stack;
[GtkChild] private unowned Gtk.Alignment loading_view;
[GtkChild] private unowned Gtk.ProgressBar download_progress;
[GtkChild] private unowned Gtk.Box gallery_view;
[GtkChild] private unowned Gtk.IconView gallery_icons;

// usable widget
[GtkChild] private Gtk.DrawingArea image_view;
[GtkChild] private unowned Gtk.DrawingArea image_view;

// must be filled with VideoPreviewWidget
[GtkChild] private Gtk.Box video_holder;
[GtkChild] private unowned Gtk.Box video_holder;
private VideoPreviewWidget video_view;

// custom data
Expand Down
4 changes: 2 additions & 2 deletions src/view/NotebookPage.vala
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ public interface Vaccine.NotebookPage : Gtk.Widget {

[GtkTemplate (ui = "/org/vaccine/app/tab.ui")]
public class Vaccine.Tab : Gtk.Box {
[GtkChild] private Gtk.Label tablabel;
[GtkChild] private Gtk.Button closebutton;
[GtkChild] private unowned Gtk.Label tablabel;
[GtkChild] private unowned Gtk.Button closebutton;

private Gtk.Widget pane;

Expand Down
16 changes: 8 additions & 8 deletions src/view/PostListRow.vala
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[GtkTemplate (ui = "/org/vaccine/app/post-list-row.ui")]
public class Vaccine.PostListRow : Gtk.ListBoxRow {
[GtkChild] private Gtk.Label post_name;
[GtkChild] private Gtk.Label post_time;
[GtkChild] private Gtk.Label post_no;

[GtkChild] private Gtk.TextView post_textview;
[GtkChild] private Gtk.Button image_button;
[GtkChild] private Gtk.Image post_thumbnail;
[GtkChild] private Gtk.Button responses_button;
[GtkChild] private unowned Gtk.Label post_name;
[GtkChild] private unowned Gtk.Label post_time;
[GtkChild] private unowned Gtk.Label post_no;

[GtkChild] private unowned Gtk.TextView post_textview;
[GtkChild] private unowned Gtk.Button image_button;
[GtkChild] private unowned Gtk.Image post_thumbnail;
[GtkChild] private unowned Gtk.Button responses_button;

private Cancellable? cancel = null;

Expand Down
8 changes: 4 additions & 4 deletions src/view/PreferencesView.vala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[GtkTemplate (ui = "/org/vaccine/app/preferences-view.ui")]
class Vaccine.PreferencesView : Gtk.Window {
[GtkChild] Gtk.Switch show_trips;
[GtkChild] Gtk.Switch filter_nsfw_content;
[GtkChild] Gtk.SpinButton image_cache_size_mb;
[GtkChild] Gtk.Switch use_dark_theme;
[GtkChild] unowned Gtk.Switch show_trips;
[GtkChild] unowned Gtk.Switch filter_nsfw_content;
[GtkChild] unowned Gtk.SpinButton image_cache_size_mb;
[GtkChild] unowned Gtk.Switch use_dark_theme;

public PreferencesView () {
App.settings.bind ("show-trips", show_trips, "active", SettingsBindFlags.DEFAULT);
Expand Down
6 changes: 3 additions & 3 deletions src/view/ThreadPane.vala
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[GtkTemplate (ui = "/org/vaccine/app/thread-pane.ui")]
public class Vaccine.ThreadPane : Gtk.Box, NotebookPage {
[GtkChild] private Gtk.ListBox list;
[GtkChild] private Gtk.Box heading_box;
[GtkChild] private Gtk.Label heading;
[GtkChild] private unowned Gtk.ListBox list;
[GtkChild] private unowned Gtk.Box heading_box;
[GtkChild] private unowned Gtk.Label heading;

public string search_text { get; set; }

Expand Down
16 changes: 8 additions & 8 deletions src/view/widgets/VideoPreviewWidget.vala
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[GtkTemplate (ui = "/org/vaccine/app/video-preview-widget.ui")]
public class Vaccine.VideoPreviewWidget : Gtk.Overlay {
[GtkChild] private Gtk.Box sink_holder;
[GtkChild] private unowned Gtk.Box sink_holder;

// control holder
[GtkChild] private Gtk.Revealer controls_revealer;
[GtkChild] private unowned Gtk.Revealer controls_revealer;

// controls
[GtkChild] public Gtk.Button btn_play;
[GtkChild] public Gtk.Image btn_play_img;
[GtkChild] public Gtk.Scale progress_scale;
[GtkChild] public Gtk.ToggleButton toggle_repeat;
[GtkChild] public unowned Gtk.Button btn_play;
[GtkChild] public unowned Gtk.Image btn_play_img;
[GtkChild] public unowned Gtk.Scale progress_scale;
[GtkChild] public unowned Gtk.ToggleButton toggle_repeat;

// info
[GtkChild] public Gtk.Label progress_text_start;
[GtkChild] public Gtk.Label progress_text_end;
[GtkChild] public unowned Gtk.Label progress_text_start;
[GtkChild] public unowned Gtk.Label progress_text_end;

// gtksink element
public dynamic Gst.Element video_sink { private set; get; }
Expand Down

0 comments on commit f48f87d

Please sign in to comment.