Skip to content

Commit

Permalink
[mate-rr] Avoid deprecated g_type_class_add_private
Browse files Browse the repository at this point in the history
  • Loading branch information
yetist authored and lukefromdc committed Jan 29, 2019
1 parent 627a1d9 commit b7dffb4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
6 changes: 2 additions & 4 deletions libmate-desktop/mate-rr-config.c
Expand Up @@ -91,7 +91,7 @@ enum {
PROP_LAST
};

G_DEFINE_TYPE (MateRRConfig, mate_rr_config, G_TYPE_OBJECT)
G_DEFINE_TYPE_WITH_PRIVATE (MateRRConfig, mate_rr_config, G_TYPE_OBJECT)

typedef struct Parser Parser;

Expand Down Expand Up @@ -449,7 +449,7 @@ configurations_read_from_file (const gchar *filename, GError **error)
static void
mate_rr_config_init (MateRRConfig *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MATE_TYPE_RR_CONFIG, MateRRConfigPrivate);
self->priv = mate_rr_config_get_instance_private (self);

self->priv->clone = FALSE;
self->priv->screen = NULL;
Expand Down Expand Up @@ -722,8 +722,6 @@ mate_rr_config_class_init (MateRRConfigClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);

g_type_class_add_private (klass, sizeof (MateRROutputInfoPrivate));

gobject_class->set_property = mate_rr_config_set_property;
gobject_class->finalize = mate_rr_config_finalize;

Expand Down
6 changes: 2 additions & 4 deletions libmate-desktop/mate-rr-labeler.c
Expand Up @@ -57,7 +57,7 @@ enum {
PROP_LAST
};

G_DEFINE_TYPE (MateRRLabeler, mate_rr_labeler, G_TYPE_OBJECT);
G_DEFINE_TYPE_WITH_PRIVATE (MateRRLabeler, mate_rr_labeler, G_TYPE_OBJECT);

static void mate_rr_labeler_finalize (GObject *object);
static void create_label_windows (MateRRLabeler *labeler);
Expand Down Expand Up @@ -186,7 +186,7 @@ mate_rr_labeler_init (MateRRLabeler *labeler)
{
GdkWindow *gdkwindow;

labeler->priv = G_TYPE_INSTANCE_GET_PRIVATE (labeler, MATE_TYPE_RR_LABELER, MateRRLabelerPrivate);
labeler->priv = mate_rr_labeler_get_instance_private (labeler);

labeler->priv->workarea_atom = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
"_NET_WORKAREA",
Expand Down Expand Up @@ -228,8 +228,6 @@ mate_rr_labeler_class_init (MateRRLabelerClass *klass)
{
GObjectClass *object_class;

g_type_class_add_private (klass, sizeof (MateRRLabelerPrivate));

object_class = (GObjectClass *) klass;

object_class->set_property = mate_rr_labeler_set_property;
Expand Down
6 changes: 2 additions & 4 deletions libmate-desktop/mate-rr-output-info.c
Expand Up @@ -30,12 +30,12 @@
#include "edid.h"
#include "mate-rr-private.h"

G_DEFINE_TYPE (MateRROutputInfo, mate_rr_output_info, G_TYPE_OBJECT)
G_DEFINE_TYPE_WITH_PRIVATE (MateRROutputInfo, mate_rr_output_info, G_TYPE_OBJECT)

static void
mate_rr_output_info_init (MateRROutputInfo *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MATE_TYPE_RR_OUTPUT_INFO, MateRROutputInfoPrivate);
self->priv = mate_rr_output_info_get_instance_private (self);

self->priv->name = NULL;
self->priv->on = FALSE;
Expand All @@ -58,8 +58,6 @@ mate_rr_output_info_class_init (MateRROutputInfoClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);

g_type_class_add_private (klass, sizeof (MateRROutputInfoPrivate));

gobject_class->finalize = mate_rr_output_info_finalize;
}

Expand Down
6 changes: 3 additions & 3 deletions libmate-desktop/mate-rr.c
Expand Up @@ -167,7 +167,8 @@ static void mate_rr_screen_get_property (GObject*, guint, GValue*, GParamSpec*);
static gboolean mate_rr_screen_initable_init (GInitable*, GCancellable*, GError**);
static void mate_rr_screen_initable_iface_init (GInitableIface *iface);
G_DEFINE_TYPE_WITH_CODE (MateRRScreen, mate_rr_screen, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, mate_rr_screen_initable_iface_init))
G_ADD_PRIVATE(MateRRScreen)
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, mate_rr_screen_initable_iface_init))

G_DEFINE_BOXED_TYPE (MateRRCrtc, mate_rr_crtc, crtc_copy, crtc_free)
G_DEFINE_BOXED_TYPE (MateRROutput, mate_rr_output, output_copy, output_free)
Expand Down Expand Up @@ -774,7 +775,6 @@ void
mate_rr_screen_class_init (MateRRScreenClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (MateRRScreenPrivate));

gobject_class->set_property = mate_rr_screen_set_property;
gobject_class->get_property = mate_rr_screen_get_property;
Expand Down Expand Up @@ -805,7 +805,7 @@ mate_rr_screen_class_init (MateRRScreenClass *klass)
void
mate_rr_screen_init (MateRRScreen *self)
{
MateRRScreenPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MATE_TYPE_RR_SCREEN, MateRRScreenPrivate);
MateRRScreenPrivate *priv = mate_rr_screen_get_instance_private (self);
self->priv = priv;

priv->gdk_screen = NULL;
Expand Down

0 comments on commit b7dffb4

Please sign in to comment.