From 8c5611d94c7f16eed496a6ae8736e194481d1e7e Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Sat, 26 Jan 2019 12:57:27 +0100 Subject: math-window: avoid deprecated 'g_type_class_add_private' --- src/math-window.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/math-window.c b/src/math-window.c index c24b3fa..54a0e90 100644 --- a/src/math-window.c +++ b/src/math-window.c @@ -48,7 +48,7 @@ struct MathWindowPrivate GtkWidget *mode_programming_menu_item; }; -G_DEFINE_TYPE (MathWindow, math_window, GTK_TYPE_WINDOW); +G_DEFINE_TYPE_WITH_PRIVATE (MathWindow, math_window, GTK_TYPE_WINDOW); enum { @@ -536,8 +536,6 @@ math_window_class_init(MathWindowClass *klass) object_class->get_property = math_window_get_property; object_class->set_property = math_window_set_property; - g_type_class_add_private(klass, sizeof(MathWindowPrivate)); - g_object_class_install_property(object_class, PROP_EQUATION, g_param_spec_object("equation", @@ -559,7 +557,7 @@ math_window_class_init(MathWindowClass *klass) static void math_window_init(MathWindow *window) { - window->priv = G_TYPE_INSTANCE_GET_PRIVATE(window, math_window_get_type(), MathWindowPrivate); + window->priv = math_window_get_instance_private (window); gtk_window_set_title(GTK_WINDOW(window), /* Title of main window */ _("Calculator")); -- cgit v1.2.1