Rename clear_template to dispose_template

Make it more clear that the function is supposed to be called during the
dispose sequence of a widget.
This commit is contained in:
Emmanuele Bassi 2022-07-07 14:09:35 +01:00
parent 63fe3345a7
commit f4f683a469
28 changed files with 34 additions and 34 deletions

View File

@ -363,7 +363,7 @@ save_cb (GtkWidget *button,
static void
constraint_editor_window_dispose (GObject *object)
{
gtk_widget_clear_template (GTK_WIDGET (object), CONSTRAINT_EDITOR_WINDOW_TYPE);
gtk_widget_dispose_template (GTK_WIDGET (object), CONSTRAINT_EDITOR_WINDOW_TYPE);
G_OBJECT_CLASS (constraint_editor_window_parent_class)->dispose (object);
}

View File

@ -610,7 +610,7 @@ constraint_editor_dispose (GObject *object)
g_clear_object (&self->model);
g_clear_object (&self->constraint);
gtk_widget_clear_template (GTK_WIDGET (object), CONSTRAINT_EDITOR_TYPE);
gtk_widget_dispose_template (GTK_WIDGET (object), CONSTRAINT_EDITOR_TYPE);
G_OBJECT_CLASS (constraint_editor_parent_class)->dispose (object);
}

View File

@ -296,7 +296,7 @@ guide_editor_dispose (GObject *object)
g_clear_object (&self->guide);
gtk_widget_clear_template (GTK_WIDGET (self), GUIDE_EDITOR_TYPE);
gtk_widget_dispose_template (GTK_WIDGET (self), GUIDE_EDITOR_TYPE);
G_OBJECT_CLASS (guide_editor_parent_class)->dispose (object);
}

View File

@ -504,7 +504,7 @@ demo_application_window_dispose (GObject *object)
demo_application_window_store_state (window);
gtk_widget_clear_template (GTK_WIDGET (window), demo_application_window_get_type ());
gtk_widget_dispose_template (GTK_WIDGET (window), demo_application_window_get_type ());
G_OBJECT_CLASS (demo_application_window_parent_class)->dispose (object);
}

View File

@ -38,7 +38,7 @@ demo3_widget_dispose (GObject *object)
g_clear_object (&self->paintable);
gtk_widget_clear_template (GTK_WIDGET (self), DEMO3_TYPE_WIDGET);
gtk_widget_dispose_template (GTK_WIDGET (self), DEMO3_TYPE_WIDGET);
G_OBJECT_CLASS (demo3_widget_parent_class)->dispose (object);
}

View File

@ -263,7 +263,7 @@ gtk_message_row_state_flags_changed (GtkWidget *widget,
static void
gtk_message_row_dispose (GObject *obj)
{
gtk_widget_clear_template (GTK_WIDGET (obj), GTK_TYPE_MESSAGE_ROW);
gtk_widget_dispose_template (GTK_WIDGET (obj), GTK_TYPE_MESSAGE_ROW);
G_OBJECT_CLASS (gtk_message_row_parent_class)->dispose (obj);
}

View File

@ -412,7 +412,7 @@ icon_browser_window_init (IconBrowserWindow *win)
static void
icon_browser_window_dispose (GObject *object)
{
gtk_widget_clear_template (GTK_WIDGET (object), ICON_BROWSER_WINDOW_TYPE);
gtk_widget_dispose_template (GTK_WIDGET (object), ICON_BROWSER_WINDOW_TYPE);
G_OBJECT_CLASS (icon_browser_window_parent_class)->dispose (object);
}

View File

@ -876,7 +876,7 @@ dark_mode_cb (GtkToggleButton *button,
static void
node_editor_window_dispose (GObject *object)
{
gtk_widget_clear_template (GTK_WIDGET (object), NODE_EDITOR_WINDOW_TYPE);
gtk_widget_dispose_template (GTK_WIDGET (object), NODE_EDITOR_WINDOW_TYPE);
G_OBJECT_CLASS (node_editor_window_parent_class)->dispose (object);
}

View File

@ -252,7 +252,7 @@ gtk_emoji_chooser_finalize (GObject *object)
static void
gtk_emoji_chooser_dispose (GObject *object)
{
gtk_widget_clear_template (GTK_WIDGET (object), GTK_TYPE_EMOJI_CHOOSER);
gtk_widget_dispose_template (GTK_WIDGET (object), GTK_TYPE_EMOJI_CHOOSER);
G_OBJECT_CLASS (gtk_emoji_chooser_parent_class)->dispose (object);
}

View File

@ -380,7 +380,7 @@ gtk_file_chooser_dialog_activate_response (GtkWidget *widget,
static void
gtk_file_chooser_dialog_dispose (GObject *object)
{
gtk_widget_clear_template (GTK_WIDGET (object), GTK_TYPE_FILE_CHOOSER_DIALOG);
gtk_widget_dispose_template (GTK_WIDGET (object), GTK_TYPE_FILE_CHOOSER_DIALOG);
G_OBJECT_CLASS (gtk_file_chooser_dialog_parent_class)->dispose (object);
}

View File

@ -3137,7 +3137,7 @@ gtk_file_chooser_widget_dispose (GObject *object)
remove_settings_signal (impl);
gtk_widget_clear_template (GTK_WIDGET (impl), GTK_TYPE_FILE_CHOOSER_WIDGET);
gtk_widget_dispose_template (GTK_WIDGET (impl), GTK_TYPE_FILE_CHOOSER_WIDGET);
G_OBJECT_CLASS (gtk_file_chooser_widget_parent_class)->dispose (object);
}

View File

@ -232,7 +232,7 @@ gtk_font_chooser_dialog_dispose (GObject *object)
/* tweak_button is not a template child */
g_clear_pointer (&dialog->tweak_button, gtk_widget_unparent);
gtk_widget_clear_template (GTK_WIDGET (dialog), GTK_TYPE_FONT_CHOOSER_DIALOG);
gtk_widget_dispose_template (GTK_WIDGET (dialog), GTK_TYPE_FONT_CHOOSER_DIALOG);
G_OBJECT_CLASS (gtk_font_chooser_dialog_parent_class)->dispose (object);
}

View File

@ -208,7 +208,7 @@ gtk_media_controls_dispose (GObject *object)
gtk_media_controls_set_media_stream (controls, NULL);
gtk_widget_clear_template (GTK_WIDGET (object), GTK_TYPE_MEDIA_CONTROLS);
gtk_widget_dispose_template (GTK_WIDGET (object), GTK_TYPE_MEDIA_CONTROLS);
G_OBJECT_CLASS (gtk_media_controls_parent_class)->dispose (object);
}

View File

@ -143,7 +143,7 @@ gtk_statusbar_dispose (GObject *object)
g_slist_free_full (self->keys, g_free);
self->keys = NULL;
gtk_widget_clear_template (GTK_WIDGET (self), GTK_TYPE_STATUSBAR);
gtk_widget_dispose_template (GTK_WIDGET (self), GTK_TYPE_STATUSBAR);
G_OBJECT_CLASS (gtk_statusbar_parent_class)->dispose (object);
}

View File

@ -392,7 +392,7 @@
* }
* ```
*
* as well as calling [method@Gtk.Widget.clear_template] from the dispose
* as well as calling [method@Gtk.Widget.dispose_template] from the dispose
* function:
*
* ```c
@ -404,7 +404,7 @@
* // Dispose objects for which you have a reference...
*
* // Clear the template children for this widget type
* gtk_widget_clear_template (GTK_WIDGET (self), FOO_TYPE_WIDGET);
* gtk_widget_dispose_template (GTK_WIDGET (self), FOO_TYPE_WIDGET);
*
* G_OBJECT_CLASS (foo_widget_parent_class)->dispose (gobject);
* }
@ -428,7 +428,7 @@
* static void
* foo_widget_dispose (GObject *gobject)
* {
* gtk_widget_clear_template (GTK_WIDGET (gobject), FOO_TYPE_WIDGET);
* gtk_widget_dispose_template (GTK_WIDGET (gobject), FOO_TYPE_WIDGET);
*
* G_OBJECT_CLASS (foo_widget_parent_class)->dispose (gobject);
* }
@ -10998,7 +10998,7 @@ out:
}
/**
* gtk_widget_clear_template:
* gtk_widget_dispose_template:
* @widget: the widget with a template
* @widget_type: the type of the widget to finalize the template for
*
@ -11022,7 +11022,7 @@ out:
* SomeWidget *self = SOME_WIDGET (gobject);
*
* // Clear the template data for SomeWidget
* gtk_widget_clear_template (GTK_WIDGET (self), SOME_TYPE_WIDGET);
* gtk_widget_dispose_template (GTK_WIDGET (self), SOME_TYPE_WIDGET);
*
* G_OBJECT_CLASS (some_widget_parent_class)->dispose (gobject);
* }
@ -11031,8 +11031,8 @@ out:
* Since: 4.8
*/
void
gtk_widget_clear_template (GtkWidget *widget,
GType widget_type)
gtk_widget_dispose_template (GtkWidget *widget,
GType widget_type)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (g_type_name (widget_type) != NULL);

View File

@ -834,7 +834,7 @@ GObject *gtk_widget_get_template_child (GtkWidget *
GType widget_type,
const char *name);
GDK_AVAILABLE_IN_4_8
void gtk_widget_clear_template (GtkWidget *widget,
void gtk_widget_dispose_template (GtkWidget *widget,
GType widget_type);
GDK_AVAILABLE_IN_ALL
void gtk_widget_class_set_template (GtkWidgetClass *widget_class,

View File

@ -462,7 +462,7 @@ dispose (GObject *o)
g_clear_object (&sl->object);
gtk_widget_clear_template (GTK_WIDGET (o), GTK_TYPE_INSPECTOR_A11Y);
gtk_widget_dispose_template (GTK_WIDGET (o), GTK_TYPE_INSPECTOR_A11Y);
G_OBJECT_CLASS (gtk_inspector_a11y_parent_class)->dispose (o);
}

View File

@ -425,7 +425,7 @@ dispose (GObject *object)
g_clear_object (&sl->actions);
g_clear_object (&sl->object);
gtk_widget_clear_template (GTK_WIDGET (sl), GTK_TYPE_INSPECTOR_ACTIONS);
gtk_widget_dispose_template (GTK_WIDGET (sl), GTK_TYPE_INSPECTOR_ACTIONS);
G_OBJECT_CLASS (gtk_inspector_actions_parent_class)->dispose (object);
}

View File

@ -355,7 +355,7 @@ gtk_inspector_clipboard_dispose (GObject *object)
gtk_inspector_clipboard_unset_display (self);
gtk_widget_clear_template (GTK_WIDGET (self), GTK_TYPE_INSPECTOR_CLIPBOARD);
gtk_widget_dispose_template (GTK_WIDGET (self), GTK_TYPE_INSPECTOR_CLIPBOARD);
G_OBJECT_CLASS (gtk_inspector_clipboard_parent_class)->dispose (object);
}

View File

@ -1097,7 +1097,7 @@ 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);
gtk_widget_dispose_template (GTK_WIDGET (gen), GTK_TYPE_INSPECTOR_GENERAL);
G_OBJECT_CLASS (gtk_inspector_general_parent_class)->dispose (object);
}

View File

@ -191,7 +191,7 @@ dispose (GObject *object)
{
GtkInspectorListData *sl = GTK_INSPECTOR_LIST_DATA (object);
gtk_widget_clear_template (GTK_WIDGET (sl), GTK_TYPE_INSPECTOR_LIST_DATA);
gtk_widget_dispose_template (GTK_WIDGET (sl), GTK_TYPE_INSPECTOR_LIST_DATA);
G_OBJECT_CLASS (gtk_inspector_list_data_parent_class)->dispose (object);
}

View File

@ -99,7 +99,7 @@ gtk_inspector_logs_init (GtkInspectorLogs *logs)
static void
dispose (GObject *object)
{
gtk_widget_clear_template (GTK_WIDGET (object), GTK_TYPE_INSPECTOR_LOGS);
gtk_widget_dispose_template (GTK_WIDGET (object), GTK_TYPE_INSPECTOR_LOGS);
G_OBJECT_CLASS (gtk_inspector_logs_parent_class)->dispose (object);
}

View File

@ -603,7 +603,7 @@ dispose (GObject *o)
{
GtkInspectorMiscInfo *sl = GTK_INSPECTOR_MISC_INFO (o);
gtk_widget_clear_template (GTK_WIDGET (sl), GTK_TYPE_INSPECTOR_MISC_INFO);
gtk_widget_dispose_template (GTK_WIDGET (sl), GTK_TYPE_INSPECTOR_MISC_INFO);
G_OBJECT_CLASS (gtk_inspector_misc_info_parent_class)->dispose (o);
}

View File

@ -2043,7 +2043,7 @@ gtk_inspector_recorder_dispose (GObject *object)
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);
gtk_widget_dispose_template (GTK_WIDGET (recorder), GTK_TYPE_INSPECTOR_RECORDER);
G_OBJECT_CLASS (gtk_inspector_recorder_parent_class)->dispose (object);
}

View File

@ -768,7 +768,7 @@ dispose (GObject *object)
g_clear_object (&rl->selection);
g_clear_object (&rl->tree_model);
gtk_widget_clear_template (GTK_WIDGET (rl), GTK_TYPE_INSPECTOR_RESOURCE_LIST);
gtk_widget_dispose_template (GTK_WIDGET (rl), GTK_TYPE_INSPECTOR_RESOURCE_LIST);
G_OBJECT_CLASS (gtk_inspector_resource_list_parent_class)->dispose (object);
}

View File

@ -176,7 +176,7 @@ dispose (GObject *object)
{
GtkInspectorTreeData *sl = GTK_INSPECTOR_TREE_DATA (object);
gtk_widget_clear_template (GTK_WIDGET (sl), GTK_TYPE_INSPECTOR_TREE_DATA);
gtk_widget_dispose_template (GTK_WIDGET (sl), GTK_TYPE_INSPECTOR_TREE_DATA);
G_OBJECT_CLASS (gtk_inspector_tree_data_parent_class)->dispose (object);
}

View File

@ -1134,7 +1134,7 @@ gtk_inspector_visual_dispose (GObject *object)
{
GtkInspectorVisual *vis = GTK_INSPECTOR_VISUAL (object);
gtk_widget_clear_template (GTK_WIDGET (vis), GTK_TYPE_INSPECTOR_VISUAL);
gtk_widget_dispose_template (GTK_WIDGET (vis), GTK_TYPE_INSPECTOR_VISUAL);
G_OBJECT_CLASS (gtk_inspector_visual_parent_class)->dispose (object);
}

View File

@ -314,7 +314,7 @@ gtk_inspector_window_dispose (GObject *object)
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);
gtk_widget_dispose_template (GTK_WIDGET (iw), GTK_TYPE_INSPECTOR_WINDOW);
G_OBJECT_CLASS (gtk_inspector_window_parent_class)->dispose (object);
}