Skip to content

Commit fc0720e

Browse files
committed
math-equation: avoid deprecated 'g_type_class_add_private'
1 parent a61f07d commit fc0720e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/math-equation.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ typedef struct {
103103
gchar *error;
104104
} SolveData;
105105

106-
G_DEFINE_TYPE (MathEquation, math_equation, GTK_TYPE_TEXT_BUFFER);
106+
G_DEFINE_TYPE_WITH_PRIVATE (MathEquation, math_equation, GTK_TYPE_TEXT_BUFFER);
107107

108108

109109
MathEquation *
@@ -1669,8 +1669,6 @@ math_equation_class_init(MathEquationClass *klass)
16691669
object_class->set_property = math_equation_set_property;
16701670
object_class->constructed = math_equation_constructed;
16711671

1672-
g_type_class_add_private(klass, sizeof(MathEquationPrivate));
1673-
16741672
number_mode_type = g_enum_register_static("NumberMode", number_mode_values);
16751673
number_format_type = math_mp_display_format_get_type();
16761674
angle_unit_type = g_enum_register_static("AngleUnit", angle_unit_values);
@@ -1923,7 +1921,7 @@ math_equation_init(MathEquation *equation)
19231921
gboolean use_default_digits = TRUE;
19241922
int i;
19251923

1926-
equation->priv = G_TYPE_INSTANCE_GET_PRIVATE(equation, math_equation_get_type(), MathEquationPrivate);
1924+
equation->priv = math_equation_get_instance_private (equation);
19271925

19281926
g_signal_connect(equation, "insert-text", G_CALLBACK(pre_insert_text_cb), equation);
19291927
g_signal_connect(equation, "delete-range", G_CALLBACK(pre_delete_range_cb), equation);

0 commit comments

Comments
 (0)