[gtk/ebassi/finish-template: 3/3] Use gtk_widget_clear_template()




commit c59bfaa50cb4bf71a1090f08288b6a42032ba1ee
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon May 23 15:17:03 2022 +0100

    Use gtk_widget_clear_template()

 gtk/gtkemojichooser.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkemojichooser.c b/gtk/gtkemojichooser.c
index 810072c146..281772a6da 100644
--- a/gtk/gtkemojichooser.c
+++ b/gtk/gtkemojichooser.c
@@ -249,6 +249,14 @@ gtk_emoji_chooser_finalize (GObject *object)
   G_OBJECT_CLASS (gtk_emoji_chooser_parent_class)->finalize (object);
 }
 
+static void
+gtk_emoji_chooser_dispose (GObject *object)
+{
+  gtk_widget_clear_template (GTK_WIDGET (object), GTK_TYPE_EMOJI_CHOOSER);
+
+  G_OBJECT_CLASS (gtk_emoji_chooser_parent_class)->dispose (object);
+}
+
 static void
 scroll_to_section (EmojiSection *section)
 {
@@ -866,7 +874,7 @@ filter_func (GtkFlowBoxChild *child,
     goto out;
 
   term_tokens = g_str_tokenize_and_fold (text, "en", NULL);
-  
+
   g_variant_get_child (emoji_data, 1, "&s", &name);
   name_tokens = g_str_tokenize_and_fold (name, "en", NULL);
   g_variant_get_child (emoji_data, 2, "^a&s", &keywords);
@@ -1203,6 +1211,7 @@ gtk_emoji_chooser_class_init (GtkEmojiChooserClass *klass)
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
   object_class->finalize = gtk_emoji_chooser_finalize;
+  object_class->dispose = gtk_emoji_chooser_dispose;
   widget_class->show = gtk_emoji_chooser_show;
   widget_class->map = gtk_emoji_chooser_map;
 
@@ -1278,7 +1287,7 @@ gtk_emoji_chooser_class_init (GtkEmojiChooserClass *klass)
    * @direction: 1 to scroll forward, -1 to scroll back
    *
    * Scrolls to the next or previous section.
-   */ 
+   */
   gtk_widget_class_install_action (widget_class, "scroll.section", "i",
                                    gtk_emoji_chooser_scroll_section);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]