Skip to content

Commit 740f9a5

Browse files
committed
math-preferences: avoid deprecated 'g_type_class_add_private'
1 parent 0dd1f73 commit 740f9a5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/math-preferences.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "math-preferences.h"
1515
#include "utility.h"
1616

17-
G_DEFINE_TYPE (MathPreferencesDialog, math_preferences, GTK_TYPE_DIALOG);
1817

1918
enum {
2019
PROP_0,
@@ -27,6 +26,8 @@ struct MathPreferencesDialogPrivate
2726
GtkBuilder *ui;
2827
};
2928

29+
G_DEFINE_TYPE_WITH_PRIVATE (MathPreferencesDialog, math_preferences, GTK_TYPE_DIALOG);
30+
3031
#define UI_DIALOGS_FILE UI_DIR "/preferences.ui"
3132
#define GET_WIDGET(ui, name) \
3233
GTK_WIDGET(gtk_builder_get_object(ui, name))
@@ -386,8 +387,6 @@ math_preferences_class_init(MathPreferencesDialogClass *klass)
386387
object_class->get_property = math_preferences_get_property;
387388
object_class->set_property = math_preferences_set_property;
388389

389-
g_type_class_add_private(klass, sizeof(MathPreferencesDialogPrivate));
390-
391390
g_object_class_install_property(object_class,
392391
PROP_EQUATION,
393392
g_param_spec_object("equation",
@@ -401,5 +400,5 @@ math_preferences_class_init(MathPreferencesDialogClass *klass)
401400
static void
402401
math_preferences_init(MathPreferencesDialog *dialog)
403402
{
404-
dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE(dialog, math_preferences_get_type(), MathPreferencesDialogPrivate);
403+
dialog->priv = math_preferences_get_instance_private (dialog);
405404
}

0 commit comments

Comments
 (0)