Mercurial > pidgin
diff libpurple/theme.c @ 32317:d72f2f13b60f
merge of 'c8c73eea7431e6f940916315ace40a41c8da3faa'
and 'fec428131bde0ae8247941bd6a3d996c984c9189'
| author | Ethan Blanton <elb@pidgin.im> |
|---|---|
| date | Fri, 21 Oct 2011 14:36:18 +0000 |
| parents | 4d92a431d0a1 |
| children |
line wrap: on
line diff
--- a/libpurple/theme.c Fri Oct 21 14:36:06 2011 +0000 +++ b/libpurple/theme.c Fri Oct 21 14:36:18 2011 +0000 @@ -25,7 +25,7 @@ #include "util.h" #define PURPLE_THEME_GET_PRIVATE(PurpleTheme) \ - ((PurpleThemePrivate *) ((PurpleTheme)->priv)) + (G_TYPE_INSTANCE_GET_PRIVATE((PurpleTheme), PURPLE_TYPE_THEME, PurpleThemePrivate)) void purple_theme_set_type_string(PurpleTheme *theme, const gchar *type); @@ -129,14 +129,6 @@ } static void -purple_theme_init(GTypeInstance *instance, - gpointer klass) -{ - PurpleTheme *theme = PURPLE_THEME(instance); - theme->priv = g_new0(PurpleThemePrivate, 1); -} - -static void purple_theme_finalize(GObject *obj) { PurpleTheme *theme = PURPLE_THEME(obj); @@ -160,6 +152,8 @@ parent_class = g_type_class_peek_parent(klass); + g_type_class_add_private(klass, sizeof(PurpleThemePrivate)); + obj_class->get_property = purple_theme_get_property; obj_class->set_property = purple_theme_set_property; obj_class->finalize = purple_theme_finalize; @@ -222,7 +216,7 @@ NULL, /* class_data */ sizeof(PurpleTheme), 0, /* n_preallocs */ - purple_theme_init, /* instance_init */ + NULL, /* instance_init */ NULL, /* value table */ }; type = g_type_register_static (G_TYPE_OBJECT,
