From e6e3f2547abb0993d08e50688b163eea5b230096 Mon Sep 17 00:00:00 2001 From: Shaun McCance Date: Mon, 9 Mar 2020 19:37:19 -0400 Subject: Remove deprecated method of doing private structs on gobjects --- libyelp/yelp-settings.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'libyelp/yelp-settings.c') diff --git a/libyelp/yelp-settings.c b/libyelp/yelp-settings.c index 05bbfb31..38cb40f3 100644 --- a/libyelp/yelp-settings.c +++ b/libyelp/yelp-settings.c @@ -1,6 +1,6 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* - * Copyright (C) 2004-2009 Shaun McCance + * Copyright (C) 2004-2020 Shaun McCance * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -29,7 +29,7 @@ #include "yelp-settings.h" -struct _YelpSettingsPriv { +struct _YelpSettingsPrivate { GMutex mutex; gchar colors[YELP_SETTINGS_NUM_COLORS][8]; @@ -73,8 +73,7 @@ enum { static const gchar *icon_names[YELP_SETTINGS_NUM_ICONS]; -G_DEFINE_TYPE (YelpSettings, yelp_settings, G_TYPE_OBJECT) -#define GET_PRIV(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), YELP_TYPE_SETTINGS, YelpSettingsPriv)) +G_DEFINE_TYPE_WITH_PRIVATE (YelpSettings, yelp_settings, G_TYPE_OBJECT) static void yelp_settings_constructed (GObject *object); static void yelp_settings_finalize (GObject *object); @@ -210,8 +209,6 @@ yelp_settings_class_init (YelpSettingsClass *klass) 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - - g_type_class_add_private (klass, sizeof (YelpSettingsPriv)); } static void @@ -219,7 +216,7 @@ yelp_settings_init (YelpSettings *settings) { gint i; - settings->priv = GET_PRIV (settings); + settings->priv = yelp_settings_get_instance_private (settings); g_mutex_init (&settings->priv->mutex); settings->priv->icon_size = 24; -- cgit v1.2.1