mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 22:10:08 +00:00
Port the inspector to gtk_widget_clear_template()
Use clear_template() instead of unparenting widgets manually.
This commit is contained in:
parent
c2ec244b84
commit
103f52bb8a
@ -462,7 +462,7 @@ dispose (GObject *o)
|
||||
|
||||
g_clear_object (&sl->object);
|
||||
|
||||
g_clear_pointer (&sl->box, gtk_widget_unparent);
|
||||
gtk_widget_clear_template (GTK_WIDGET (o), GTK_TYPE_INSPECTOR_A11Y);
|
||||
|
||||
G_OBJECT_CLASS (gtk_inspector_a11y_parent_class)->dispose (o);
|
||||
}
|
||||
|
@ -420,14 +420,12 @@ static void
|
||||
dispose (GObject *object)
|
||||
{
|
||||
GtkInspectorActions *sl = GTK_INSPECTOR_ACTIONS (object);
|
||||
GtkWidget *child;
|
||||
|
||||
g_clear_object (&sl->sorted);
|
||||
g_clear_object (&sl->actions);
|
||||
g_clear_object (&sl->object);
|
||||
|
||||
while ((child = gtk_widget_get_first_child (GTK_WIDGET (sl))))
|
||||
gtk_widget_unparent (child);
|
||||
gtk_widget_clear_template (GTK_WIDGET (sl), GTK_TYPE_INSPECTOR_ACTIONS);
|
||||
|
||||
G_OBJECT_CLASS (gtk_inspector_actions_parent_class)->dispose (object);
|
||||
}
|
||||
|
@ -355,7 +355,7 @@ gtk_inspector_clipboard_dispose (GObject *object)
|
||||
|
||||
gtk_inspector_clipboard_unset_display (self);
|
||||
|
||||
g_clear_pointer (&self->swin, gtk_widget_unparent);
|
||||
gtk_widget_clear_template (GTK_WIDGET (self), GTK_TYPE_INSPECTOR_CLIPBOARD);
|
||||
|
||||
G_OBJECT_CLASS (gtk_inspector_clipboard_parent_class)->dispose (object);
|
||||
}
|
||||
|
@ -1087,8 +1087,6 @@ gtk_inspector_general_dispose (GObject *object)
|
||||
GtkInspectorGeneral *gen = GTK_INSPECTOR_GENERAL (object);
|
||||
GList *list, *l;
|
||||
|
||||
g_clear_pointer (&gen->swin, gtk_widget_unparent);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (gen->display, G_CALLBACK (seat_added), gen);
|
||||
g_signal_handlers_disconnect_by_func (gen->display, G_CALLBACK (seat_removed), gen);
|
||||
g_signal_handlers_disconnect_by_func (gen->display, G_CALLBACK (populate_display_notify_cb), gen);
|
||||
@ -1099,6 +1097,8 @@ gtk_inspector_general_dispose (GObject *object)
|
||||
disconnect_seat (gen, GDK_SEAT (l->data));
|
||||
g_list_free (list);
|
||||
|
||||
gtk_widget_clear_template (GTK_WIDGET (gen), GTK_TYPE_INSPECTOR_GENERAL);
|
||||
|
||||
G_OBJECT_CLASS (gtk_inspector_general_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
|
@ -190,10 +190,8 @@ static void
|
||||
dispose (GObject *object)
|
||||
{
|
||||
GtkInspectorListData *sl = GTK_INSPECTOR_LIST_DATA (object);
|
||||
GtkWidget *child;
|
||||
|
||||
while ((child = gtk_widget_get_first_child (GTK_WIDGET (sl))))
|
||||
gtk_widget_unparent (child);
|
||||
gtk_widget_clear_template (GTK_WIDGET (sl), GTK_TYPE_INSPECTOR_LIST_DATA);
|
||||
|
||||
G_OBJECT_CLASS (gtk_inspector_list_data_parent_class)->dispose (object);
|
||||
}
|
||||
|
@ -99,10 +99,7 @@ gtk_inspector_logs_init (GtkInspectorLogs *logs)
|
||||
static void
|
||||
dispose (GObject *object)
|
||||
{
|
||||
GtkWidget *child;
|
||||
|
||||
while ((child = gtk_widget_get_first_child (GTK_WIDGET (object))))
|
||||
gtk_widget_unparent (child);
|
||||
gtk_widget_clear_template (GTK_WIDGET (object), GTK_TYPE_INSPECTOR_LOGS);
|
||||
|
||||
G_OBJECT_CLASS (gtk_inspector_logs_parent_class)->dispose (object);
|
||||
}
|
||||
|
@ -603,7 +603,7 @@ dispose (GObject *o)
|
||||
{
|
||||
GtkInspectorMiscInfo *sl = GTK_INSPECTOR_MISC_INFO (o);
|
||||
|
||||
g_clear_pointer (&sl->swin, gtk_widget_unparent);
|
||||
gtk_widget_clear_template (GTK_WIDGET (sl), GTK_TYPE_INSPECTOR_MISC_INFO);
|
||||
|
||||
G_OBJECT_CLASS (gtk_inspector_misc_info_parent_class)->dispose (o);
|
||||
}
|
||||
|
@ -2039,11 +2039,12 @@ gtk_inspector_recorder_dispose (GObject *object)
|
||||
{
|
||||
GtkInspectorRecorder *recorder = GTK_INSPECTOR_RECORDER (object);
|
||||
|
||||
g_clear_pointer (&recorder->box, gtk_widget_unparent);
|
||||
g_clear_object (&recorder->render_node_model);
|
||||
g_clear_object (&recorder->render_node_root_model);
|
||||
g_clear_object (&recorder->render_node_selection);
|
||||
|
||||
gtk_widget_clear_template (GTK_WIDGET (recorder), GTK_TYPE_INSPECTOR_RECORDER);
|
||||
|
||||
G_OBJECT_CLASS (gtk_inspector_recorder_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
|
@ -765,10 +765,11 @@ dispose (GObject *object)
|
||||
{
|
||||
GtkInspectorResourceList *rl = GTK_INSPECTOR_RESOURCE_LIST (object);
|
||||
|
||||
g_clear_pointer (&rl->stack, gtk_widget_unparent);
|
||||
g_clear_object (&rl->selection);
|
||||
g_clear_object (&rl->tree_model);
|
||||
|
||||
gtk_widget_clear_template (GTK_WIDGET (rl), GTK_TYPE_INSPECTOR_RESOURCE_LIST);
|
||||
|
||||
G_OBJECT_CLASS (gtk_inspector_resource_list_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
|
@ -175,10 +175,8 @@ static void
|
||||
dispose (GObject *object)
|
||||
{
|
||||
GtkInspectorTreeData *sl = GTK_INSPECTOR_TREE_DATA (object);
|
||||
GtkWidget *child;
|
||||
|
||||
while ((child = gtk_widget_get_first_child (GTK_WIDGET (sl))))
|
||||
gtk_widget_unparent (child);
|
||||
gtk_widget_clear_template (GTK_WIDGET (sl), GTK_TYPE_INSPECTOR_TREE_DATA);
|
||||
|
||||
G_OBJECT_CLASS (gtk_inspector_tree_data_parent_class)->dispose (object);
|
||||
}
|
||||
|
@ -1091,12 +1091,12 @@ gtk_inspector_visual_constructed (GObject *object)
|
||||
|
||||
G_OBJECT_CLASS (gtk_inspector_visual_parent_class)->constructed (object);
|
||||
|
||||
g_signal_connect (vis->visual_box, "keynav-failed", G_CALLBACK (keynav_failed), vis);
|
||||
g_signal_connect (vis->debug_box, "keynav-failed", G_CALLBACK (keynav_failed), vis);
|
||||
g_signal_connect (vis->misc_box, "keynav-failed", G_CALLBACK (keynav_failed), vis);
|
||||
g_signal_connect (vis->visual_box, "row-activated", G_CALLBACK (row_activated), vis);
|
||||
g_signal_connect (vis->debug_box, "row-activated", G_CALLBACK (row_activated), vis);
|
||||
g_signal_connect (vis->misc_box, "row-activated", G_CALLBACK (row_activated), vis);
|
||||
g_signal_connect (vis->visual_box, "keynav-failed", G_CALLBACK (keynav_failed), vis);
|
||||
g_signal_connect (vis->debug_box, "keynav-failed", G_CALLBACK (keynav_failed), vis);
|
||||
g_signal_connect (vis->misc_box, "keynav-failed", G_CALLBACK (keynav_failed), vis);
|
||||
g_signal_connect (vis->visual_box, "row-activated", G_CALLBACK (row_activated), vis);
|
||||
g_signal_connect (vis->debug_box, "row-activated", G_CALLBACK (row_activated), vis);
|
||||
g_signal_connect (vis->misc_box, "row-activated", G_CALLBACK (row_activated), vis);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1134,7 +1134,7 @@ gtk_inspector_visual_dispose (GObject *object)
|
||||
{
|
||||
GtkInspectorVisual *vis = GTK_INSPECTOR_VISUAL (object);
|
||||
|
||||
g_clear_pointer (&vis->swin, gtk_widget_unparent);
|
||||
gtk_widget_clear_template (GTK_WIDGET (vis), GTK_TYPE_INSPECTOR_VISUAL);
|
||||
|
||||
G_OBJECT_CLASS (gtk_inspector_visual_parent_class)->dispose (object);
|
||||
}
|
||||
|
@ -311,10 +311,11 @@ gtk_inspector_window_dispose (GObject *object)
|
||||
|
||||
g_object_set_data (G_OBJECT (iw->inspected_display), "-gtk-inspector", NULL);
|
||||
|
||||
g_clear_pointer (&iw->top_stack, gtk_widget_unparent);
|
||||
g_clear_object (&iw->flash_overlay);
|
||||
g_clear_pointer (&iw->objects, g_array_unref);
|
||||
|
||||
gtk_widget_clear_template (GTK_WIDGET (iw), GTK_TYPE_INSPECTOR_WINDOW);
|
||||
|
||||
G_OBJECT_CLASS (gtk_inspector_window_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user