[gtk+] Ensure print-related types are registered



commit 768e6a45796aec32bbc2119e5742ac2332b1c084
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Mar 4 20:35:09 2015 -0500

    Ensure print-related types are registered
    
    These types are not covered by g_test_register_all_types,
    and having the types registered when a print dialog is used
    helps in cases where GTK+ is dlopened.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=745065

 gtk/gtkprintunixdialog.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c
index 06cb4b6..e1c19bc 100644
--- a/gtk/gtkprintunixdialog.c
+++ b/gtk/gtkprintunixdialog.c
@@ -726,6 +726,11 @@ gtk_print_unix_dialog_init (GtkPrintUnixDialog *dialog)
   priv->support_selection = FALSE;
   priv->has_selection = FALSE;
 
+  g_type_ensure (GTK_TYPE_PRINTER);
+  g_type_ensure (GTK_TYPE_PRINTER_OPTION);
+  g_type_ensure (GTK_TYPE_PRINTER_OPTION_SET);
+  g_type_ensure (GTK_TYPE_PRINTER_OPTION_WIDGET);
+
   gtk_widget_init_template (GTK_WIDGET (dialog));
   gtk_dialog_set_use_header_bar_from_setting (GTK_DIALOG (dialog));
   gtk_dialog_add_buttons (GTK_DIALOG (dialog),
@@ -737,7 +742,7 @@ gtk_print_unix_dialog_init (GtkPrintUnixDialog *dialog)
   widget = gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
   gtk_widget_set_sensitive (widget, FALSE);
 
-  /* Treeview auxilary functions need to be setup here  */
+  /* Treeview auxiliary functions need to be setup here */
   gtk_tree_model_filter_set_visible_func (priv->printer_list_filter,
                                           (GtkTreeModelFilterVisibleFunc) is_printer_active,
                                           dialog,


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