diff options
author | Wu Xiaotian <[email protected]> | 2019-05-22 12:03:03 +0800 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-06-06 14:33:45 +0200 |
commit | 9dc5fef7fcf9a1040c95055c324f18a551060072 (patch) | |
tree | 03288d451a1ee888a6b368e52522c30f960f7a5c /libslab/themed-icon.c | |
parent | 47220bd4a0b39a07292cc76882b8e5bd7958a567 (diff) | |
download | mate-control-center-9dc5fef7fcf9a1040c95055c324f18a551060072.tar.bz2 mate-control-center-9dc5fef7fcf9a1040c95055c324f18a551060072.tar.xz |
libslab: avoid deprecated g_type_class_add_private
Diffstat (limited to 'libslab/themed-icon.c')
-rw-r--r-- | libslab/themed-icon.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/libslab/themed-icon.c b/libslab/themed-icon.c index 29c4a0cc..124a224a 100644 --- a/libslab/themed-icon.c +++ b/libslab/themed-icon.c @@ -43,9 +43,7 @@ typedef struct gboolean icon_loaded; } ThemedIconPrivate; -#define THEMED_ICON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), THEMED_ICON_TYPE, ThemedIconPrivate)) - -G_DEFINE_TYPE (ThemedIcon, themed_icon, GTK_TYPE_IMAGE) +G_DEFINE_TYPE_WITH_PRIVATE (ThemedIcon, themed_icon, GTK_TYPE_IMAGE) static void themed_icon_class_init (ThemedIconClass * themed_icon_class) { @@ -59,8 +57,6 @@ static void themed_icon_class_init (ThemedIconClass * themed_icon_class) widget_class->show = themed_icon_show; widget_class->style_updated = themed_icon_style_updated; - g_type_class_add_private (themed_icon_class, sizeof (ThemedIconPrivate)); - g_object_class_install_property (g_obj_class, PROP_ICON_ID, g_param_spec_string ("icon-id", "icon-id", "the identifier of the icon", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); @@ -74,7 +70,7 @@ static void themed_icon_class_init (ThemedIconClass * themed_icon_class) static void themed_icon_init (ThemedIcon * icon) { - ThemedIconPrivate *priv = THEMED_ICON_GET_PRIVATE (icon); + ThemedIconPrivate *priv = themed_icon_get_instance_private (icon); priv->icon_loaded = FALSE; } @@ -148,7 +144,7 @@ static void themed_icon_show (GtkWidget * widget) { ThemedIcon *icon = THEMED_ICON (widget); - ThemedIconPrivate *priv = THEMED_ICON_GET_PRIVATE (icon); + ThemedIconPrivate *priv = themed_icon_get_instance_private (icon); if (!priv->icon_loaded) priv->icon_loaded = load_image_by_id (GTK_IMAGE (icon), icon->size, icon->id); |