Skip to content

Commit 8c5611d

Browse files
committed
math-window: avoid deprecated 'g_type_class_add_private'
1 parent 9ac7540 commit 8c5611d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/math-window.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct MathWindowPrivate
4848
GtkWidget *mode_programming_menu_item;
4949
};
5050

51-
G_DEFINE_TYPE (MathWindow, math_window, GTK_TYPE_WINDOW);
51+
G_DEFINE_TYPE_WITH_PRIVATE (MathWindow, math_window, GTK_TYPE_WINDOW);
5252

5353
enum
5454
{
@@ -536,8 +536,6 @@ math_window_class_init(MathWindowClass *klass)
536536
object_class->get_property = math_window_get_property;
537537
object_class->set_property = math_window_set_property;
538538

539-
g_type_class_add_private(klass, sizeof(MathWindowPrivate));
540-
541539
g_object_class_install_property(object_class,
542540
PROP_EQUATION,
543541
g_param_spec_object("equation",
@@ -559,7 +557,7 @@ math_window_class_init(MathWindowClass *klass)
559557
static void
560558
math_window_init(MathWindow *window)
561559
{
562-
window->priv = G_TYPE_INSTANCE_GET_PRIVATE(window, math_window_get_type(), MathWindowPrivate);
560+
window->priv = math_window_get_instance_private (window);
563561
gtk_window_set_title(GTK_WINDOW(window),
564562
/* Title of main window */
565563
_("Calculator"));

0 commit comments

Comments
 (0)