Skip to content

Commit b85ea87

Browse files
committed
math-converter: avoid deprecated 'g_type_class_add_private'
1 parent f9e4e7e commit b85ea87

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/math-converter.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct MathConverterPrivate
3333
};
3434

3535

36-
G_DEFINE_TYPE (MathConverter, math_converter, GTK_TYPE_BOX);
36+
G_DEFINE_TYPE_WITH_PRIVATE (MathConverter, math_converter, GTK_TYPE_BOX);
3737

3838
static void display_changed_cb(MathEquation *equation, GParamSpec *spec, MathConverter *converter);
3939
static void update_from_model(MathConverter *converter);
@@ -288,8 +288,6 @@ math_converter_get_conversion(MathConverter *converter, Unit **from_unit, Unit *
288288
static void
289289
math_converter_class_init(MathConverterClass *klass)
290290
{
291-
g_type_class_add_private(klass, sizeof(MathConverterPrivate));
292-
293291
signals[CHANGED] =
294292
g_signal_new("changed",
295293
G_TYPE_FROM_CLASS (klass),
@@ -387,7 +385,7 @@ math_converter_init(MathConverter *converter)
387385
GtkWidget *hbox, *label, *swap_button;
388386
GtkCellRenderer *renderer;
389387

390-
converter->priv = G_TYPE_INSTANCE_GET_PRIVATE(converter, math_converter_get_type(), MathConverterPrivate);
388+
converter->priv = math_converter_get_instance_private (converter);
391389

392390
gtk_box_set_spacing(GTK_BOX(converter), 6);
393391
gtk_orientable_set_orientation (GTK_ORIENTABLE (converter),

0 commit comments

Comments
 (0)