[nautilus/wip/antoniof/gtk4-preparation-discontinued-api: 14/19] window-slot: Drop non-window usage of gtk_widget_destroy()
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/gtk4-preparation-discontinued-api: 14/19] window-slot: Drop non-window usage of gtk_widget_destroy()
- Date: Wed, 5 Jan 2022 01:44:37 +0000 (UTC)
commit 9e15ee29b24a3b3bc9644e9deeebd3bf29647205
Author: António Fernandes <antoniof gnome org>
Date: Wed Dec 22 22:40:04 2021 +0000
window-slot: Drop non-window usage of gtk_widget_destroy()
When switching to GTK 4 we are going to replace gtk_widget_destroy()
with gtk_window_destroy(). This requires we drop all usage of this
method on widgets other than GtkWindows.
For the content view, add a gtk_box_remove() which matches the
gtk_box_append() already present in this file.
For the query editor, there is no need to destroy it here, because
this is not the file where it's added to its parent. It's added in
the toolbar, and the toolbar already has a weak ref on the slot to
do this when the slot is destroyed. So, simply clear the reference
we have sunk in this file.
src/nautilus-window-slot.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 25b582610..e1d3ae810 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -2817,7 +2817,7 @@ nautilus_window_slot_switch_new_content_view (NautilusWindowSlot *self)
g_binding_unbind (self->extensions_background_menu_binding);
g_binding_unbind (self->templates_menu_binding);
widget = GTK_WIDGET (self->content_view);
- gtk_widget_destroy (widget);
+ gtk_box_remove (GTK_BOX (self), widget);
g_clear_object (&self->content_view);
}
@@ -2903,13 +2903,13 @@ nautilus_window_slot_dispose (GObject *object)
if (self->content_view)
{
- gtk_widget_destroy (GTK_WIDGET (self->content_view));
+ gtk_box_remove (GTK_BOX (self), GTK_WIDGET (self->content_view));
g_clear_object (&self->content_view);
}
if (self->new_content_view)
{
- gtk_widget_destroy (GTK_WIDGET (self->new_content_view));
+ gtk_box_remove (GTK_BOX (self), GTK_WIDGET (self->new_content_view));
g_clear_object (&self->new_content_view);
}
@@ -2928,7 +2928,6 @@ nautilus_window_slot_dispose (GObject *object)
if (self->query_editor)
{
- gtk_widget_destroy (GTK_WIDGET (self->query_editor));
g_clear_object (&self->query_editor);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]