summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-01-26 16:25:14 +0100
committerZenWalker <[email protected]>2019-01-29 15:16:29 +0100
commit0dd1f73683ef154d892e6f26731f45b4d37439ef (patch)
treec9253099da93def028adbc93647fa13059055ec9 /src
parentb85ea87947cfe40246ccfa8844f406069c91cf62 (diff)
downloadmate-calc-0dd1f73683ef154d892e6f26731f45b4d37439ef.tar.bz2
mate-calc-0dd1f73683ef154d892e6f26731f45b4d37439ef.tar.xz
math-variables: avoid deprecated 'g_type_class_add_private'
Diffstat (limited to 'src')
-rw-r--r--src/math-variables.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/math-variables.c b/src/math-variables.c
index 7e20cdc..b8e57cf 100644
--- a/src/math-variables.c
+++ b/src/math-variables.c
@@ -22,7 +22,7 @@ struct MathVariablesPrivate
MpSerializer *serializer;
};
-G_DEFINE_TYPE (MathVariables, math_variables, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE (MathVariables, math_variables, G_TYPE_OBJECT);
MathVariables *
@@ -163,14 +163,13 @@ math_variables_delete(MathVariables *variables, const char *name)
static void
math_variables_class_init (MathVariablesClass *klass)
{
- g_type_class_add_private (klass, sizeof (MathVariablesPrivate));
}
static void
math_variables_init(MathVariables *variables)
{
- variables->priv = G_TYPE_INSTANCE_GET_PRIVATE (variables, math_variables_get_type(), MathVariablesPrivate);
+ variables->priv = math_variables_get_instance_private (variables);
variables->priv->registers = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
variables->priv->file_name = g_build_filename(g_get_user_data_dir(), "mate-calc", "registers", NULL);
variables->priv->serializer = mp_serializer_new(MP_DISPLAY_FORMAT_SCIENTIFIC, 10, 50);