From b5a6f0565462ace2f34a94de9436eed12bbd248e Mon Sep 17 00:00:00 2001 From: matthiakl Date: Fri, 9 Jul 2021 14:25:05 +0200 Subject: [PATCH] Resolve some deprecation warnings --- src/choose_ignorepkgs_dialog.vala | 2 +- src/pamac-install/progress_dialog.vala | 6 +- src/pamac-manager/history_dialog.vala | 2 +- src/pamac-manager/manager_window.vala | 74 +++++++++++----------- src/pamac-system-daemon/system_daemon.vala | 4 +- src/preferences_dialog.vala | 52 +++++++-------- src/progress_box.vala | 4 +- src/transaction_sum_dialog.vala | 4 +- 8 files changed, 74 insertions(+), 74 deletions(-) diff --git a/src/choose_ignorepkgs_dialog.vala b/src/choose_ignorepkgs_dialog.vala index 95ad5fe..1242526 100644 --- a/src/choose_ignorepkgs_dialog.vala +++ b/src/choose_ignorepkgs_dialog.vala @@ -27,7 +27,7 @@ namespace Pamac { class ChooseIgnorepkgsDialog : Gtk.Dialog { [GtkChild] - public Gtk.TreeView treeview; + public unowned Gtk.TreeView treeview; public Gtk.ListStore pkgs_list; diff --git a/src/pamac-install/progress_dialog.vala b/src/pamac-install/progress_dialog.vala index c208c65..e25a8f2 100644 --- a/src/pamac-install/progress_dialog.vala +++ b/src/pamac-install/progress_dialog.vala @@ -26,11 +26,11 @@ namespace Pamac { class ProgressDialog : Gtk.ApplicationWindow { [GtkChild] - public Gtk.Box box; + public unowned Gtk.Box box; [GtkChild] - public Gtk.Button close_button; + public unowned Gtk.Button close_button; [GtkChild] - public Gtk.Expander expander; + public unowned Gtk.Expander expander; public ProgressDialog () { Object (); diff --git a/src/pamac-manager/history_dialog.vala b/src/pamac-manager/history_dialog.vala index 72f0108..ce02cd9 100644 --- a/src/pamac-manager/history_dialog.vala +++ b/src/pamac-manager/history_dialog.vala @@ -26,7 +26,7 @@ namespace Pamac { class HistoryDialog : Gtk.Dialog { [GtkChild] - public Gtk.TextView textview; + public unowned Gtk.TextView textview; public HistoryDialog (Gtk.ApplicationWindow window) { int use_header_bar; diff --git a/src/pamac-manager/manager_window.vala b/src/pamac-manager/manager_window.vala index d7cb410..8c90ae1 100644 --- a/src/pamac-manager/manager_window.vala +++ b/src/pamac-manager/manager_window.vala @@ -53,88 +53,88 @@ namespace Pamac { // manager objects [GtkChild] - public Gtk.Stack main_stack; + public unowned Gtk.Stack main_stack; [GtkChild] - Gtk.Button button_back; + unowned Gtk.Button button_back; [GtkChild] - Gtk.MenuButton button_menu; + unowned Gtk.MenuButton button_menu; #if ENABLE_HAMBURGER [GtkChild] - Gtk.ModelButton preferences_button; + unowned Gtk.ModelButton preferences_button; #else [GtkChild] - Gtk.HeaderBar headerbar; + unowned Gtk.HeaderBar headerbar; #endif [GtkChild] - Gtk.TreeView packages_treeview; + unowned Gtk.TreeView packages_treeview; [GtkChild] - Gtk.TreeViewColumn packages_state_column; + unowned Gtk.TreeViewColumn packages_state_column; #if DISABLE_AUR [GtkChild] - Gtk.ScrolledWindow aur_scrolledwindow; + unowned Gtk.ScrolledWindow aur_scrolledwindow; #else [GtkChild] - Gtk.TreeView aur_treeview; + unowned Gtk.TreeView aur_treeview; [GtkChild] - Gtk.TreeViewColumn aur_state_column; + unowned Gtk.TreeViewColumn aur_state_column; #endif [GtkChild] - public Gtk.Stack filters_stack; + public unowned Gtk.Stack filters_stack; [GtkChild] - Gtk.StackSwitcher filters_stackswitcher; + unowned Gtk.StackSwitcher filters_stackswitcher; [GtkChild] - Gtk.SearchEntry search_entry; + unowned Gtk.SearchEntry search_entry; [GtkChild] - Gtk.TreeView search_treeview; + unowned Gtk.TreeView search_treeview; [GtkChild] - Gtk.TreeView groups_treeview; + unowned Gtk.TreeView groups_treeview; [GtkChild] - Gtk.TreeView states_treeview; + unowned Gtk.TreeView states_treeview; [GtkChild] - Gtk.TreeView repos_treeview; + unowned Gtk.TreeView repos_treeview; [GtkChild] - Gtk.Stack packages_stack; + unowned Gtk.Stack packages_stack; [GtkChild] - Gtk.StackSwitcher packages_stackswitcher; + unowned Gtk.StackSwitcher packages_stackswitcher; [GtkChild] - Gtk.Label updated_label; + unowned Gtk.Label updated_label; [GtkChild] - Gtk.Stack properties_stack; + unowned Gtk.Stack properties_stack; #if DISABLE_AUR #else [GtkChild] - Gtk.StackSwitcher properties_stackswitcher; + unowned Gtk.StackSwitcher properties_stackswitcher; #endif [GtkChild] - Gtk.Grid deps_grid; + unowned Gtk.Grid deps_grid; [GtkChild] - Gtk.Grid details_grid; + unowned Gtk.Grid details_grid; [GtkChild] - Gtk.ScrolledWindow files_scrolledwindow; + unowned Gtk.ScrolledWindow files_scrolledwindow; [GtkChild] - Gtk.Label name_label; + unowned Gtk.Label name_label; [GtkChild] - Gtk.Label desc_label; + unowned Gtk.Label desc_label; [GtkChild] - Gtk.Label link_label; + unowned Gtk.Label link_label; [GtkChild] - Gtk.Label licenses_label; + unowned Gtk.Label licenses_label; [GtkChild] - Gtk.ToggleButton remove_togglebutton; + unowned Gtk.ToggleButton remove_togglebutton; [GtkChild] - Gtk.ToggleButton reinstall_togglebutton; + unowned Gtk.ToggleButton reinstall_togglebutton; [GtkChild] - Gtk.ToggleButton install_togglebutton; + unowned Gtk.ToggleButton install_togglebutton; [GtkChild] - Gtk.TextView files_textview; + unowned Gtk.TextView files_textview; [GtkChild] - Gtk.Box transaction_infobox; + unowned Gtk.Box transaction_infobox; [GtkChild] - Gtk.Button details_button; + unowned Gtk.Button details_button; [GtkChild] - Gtk.Button apply_button; + unowned Gtk.Button apply_button; [GtkChild] - Gtk.Button cancel_button; + unowned Gtk.Button cancel_button; // menu Gtk.Menu right_click_menu; diff --git a/src/pamac-system-daemon/system_daemon.vala b/src/pamac-system-daemon/system_daemon.vala index c8193f6..1abc793 100644 --- a/src/pamac-system-daemon/system_daemon.vala +++ b/src/pamac-system-daemon/system_daemon.vala @@ -1939,8 +1939,8 @@ private int cb_fetch (void *ctx, string fileurl, string localpath, int force) { // start from scratch only download if our local is out of date. system_daemon.curl.setopt (Curl.Option.TIMECONDITION, Curl.TimeCond.IFMODSINCE); FileInfo info = destfile.query_info ("time::modified", 0); - TimeVal time = info.get_modification_time (); - system_daemon.curl.setopt (Curl.Option.TIMEVALUE, time.tv_sec); + DateTime time = info.get_modification_date_time (); + system_daemon.curl.setopt (Curl.Option.TIMEVALUE, time.to_unix()); } else if (tempfile.query_exists ()) { // a previous partial download exists, resume from end of file. FileInfo info = tempfile.query_info ("standard::size", 0); diff --git a/src/preferences_dialog.vala b/src/preferences_dialog.vala index 487df6d..bf1bc17 100644 --- a/src/preferences_dialog.vala +++ b/src/preferences_dialog.vala @@ -24,60 +24,60 @@ namespace Pamac { class PreferencesDialog : Gtk.Dialog { [GtkChild] - Gtk.Switch remove_unrequired_deps_button; + unowned Gtk.Switch remove_unrequired_deps_button; [GtkChild] - Gtk.Switch update_files_db_button; + unowned Gtk.Switch update_files_db_button; [GtkChild] - Gtk.Switch check_space_button; + unowned Gtk.Switch check_space_button; [GtkChild] - Gtk.Switch check_updates_button; + unowned Gtk.Switch check_updates_button; [GtkChild] - Gtk.Label refresh_period_label; + unowned Gtk.Label refresh_period_label; [GtkChild] - Gtk.SpinButton refresh_period_spin_button; + unowned Gtk.SpinButton refresh_period_spin_button; [GtkChild] - Gtk.CheckButton no_update_hide_icon_checkbutton; + unowned Gtk.CheckButton no_update_hide_icon_checkbutton; [GtkChild] - Gtk.Box ignorepkgs_box; + unowned Gtk.Box ignorepkgs_box; [GtkChild] - Gtk.TreeView ignorepkgs_treeview; + unowned Gtk.TreeView ignorepkgs_treeview; [GtkChild] - Gtk.Box mirrors_config_box; + unowned Gtk.Box mirrors_config_box; [GtkChild] - Gtk.ComboBoxText mirrors_country_comboboxtext; + unowned Gtk.ComboBoxText mirrors_country_comboboxtext; [GtkChild] - Gtk.ComboBoxText mirrors_list_generation_method_comboboxtext; + unowned Gtk.ComboBoxText mirrors_list_generation_method_comboboxtext; [GtkChild] - Gtk.Button generate_mirrors_list_button; + unowned Gtk.Button generate_mirrors_list_button; #if DISABLE_AUR [GtkChild] - Gtk.Stack stack; + unowned Gtk.Stack stack; [GtkChild] - Gtk.Box aur_config_box; + unowned Gtk.Box aur_config_box; #else [GtkChild] - Gtk.Switch enable_aur_button; + unowned Gtk.Switch enable_aur_button; [GtkChild] - Gtk.CheckButton search_aur_checkbutton; + unowned Gtk.CheckButton search_aur_checkbutton; [GtkChild] - Gtk.Label aur_build_dir_label; + unowned Gtk.Label aur_build_dir_label; [GtkChild] - Gtk.FileChooserButton aur_build_dir_file_chooser; + unowned Gtk.FileChooserButton aur_build_dir_file_chooser; [GtkChild] - Gtk.CheckButton check_aur_updates_checkbutton; + unowned Gtk.CheckButton check_aur_updates_checkbutton; #endif [GtkChild] - Gtk.Label cache_keep_nb_label; + unowned Gtk.Label cache_keep_nb_label; [GtkChild] - Gtk.SpinButton cache_keep_nb_spin_button; + unowned Gtk.SpinButton cache_keep_nb_spin_button; [GtkChild] - Gtk.CheckButton cache_only_uninstalled_checkbutton; + unowned Gtk.CheckButton cache_only_uninstalled_checkbutton; [GtkChild] - Gtk.ColorButton terminal_background; + unowned Gtk.ColorButton terminal_background; [GtkChild] - Gtk.ColorButton terminal_foreground; + unowned Gtk.ColorButton terminal_foreground; [GtkChild] - Gtk.FontButton terminal_font; + unowned Gtk.FontButton terminal_font; Gtk.ListStore ignorepkgs_liststore; Transaction transaction; diff --git a/src/progress_box.vala b/src/progress_box.vala index d5c2e8f..3af29c9 100644 --- a/src/progress_box.vala +++ b/src/progress_box.vala @@ -26,9 +26,9 @@ namespace Pamac { public class ProgressBox : Gtk.Box { [GtkChild] - public Gtk.ProgressBar progressbar; + public unowned Gtk.ProgressBar progressbar; [GtkChild] - public Gtk.Label action_label; + public unowned Gtk.Label action_label; public ProgressBox () { Object (); diff --git a/src/transaction_sum_dialog.vala b/src/transaction_sum_dialog.vala index bf2088a..13cbc39 100644 --- a/src/transaction_sum_dialog.vala +++ b/src/transaction_sum_dialog.vala @@ -26,9 +26,9 @@ namespace Pamac { class TransactionSumDialog : Gtk.Dialog { [GtkChild] - public Gtk.Label top_label; + public unowned Gtk.Label top_label; [GtkChild] - Gtk.TreeView treeview; + unowned Gtk.TreeView treeview; public Gtk.ListStore sum_list;