summaryrefslogtreecommitdiff
path: root/src/gs-job.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-09-16 10:25:15 +0200
committerVictor Kareh <[email protected]>2019-10-02 06:48:58 -0400
commit16f3cf40f76520d6e21b370205a6c72f5440b06d (patch)
tree3aa8671679dac7f2e41a6df0fdfc8898ee687794 /src/gs-job.c
parente04084dc2787ca240f10bd73005044faa4682d1e (diff)
downloadmate-screensaver-16f3cf40f76520d6e21b370205a6c72f5440b06d.tar.bz2
mate-screensaver-16f3cf40f76520d6e21b370205a6c72f5440b06d.tar.xz
gs-job: avoid 'g_type_class_add_private'
Diffstat (limited to 'src/gs-job.c')
-rw-r--r--src/gs-job.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/gs-job.c b/src/gs-job.c
index e0d4d3e..c15f6bd 100644
--- a/src/gs-job.c
+++ b/src/gs-job.c
@@ -48,8 +48,6 @@ static void gs_job_class_init (GSJobClass *klass);
static void gs_job_init (GSJob *job);
static void gs_job_finalize (GObject *object);
-#define GS_JOB_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GS_TYPE_JOB, GSJobPrivate))
-
typedef enum
{
GS_JOB_INVALID,
@@ -70,7 +68,7 @@ struct GSJobPrivate
char *command;
};
-G_DEFINE_TYPE (GSJob, gs_job, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GSJob, gs_job, G_TYPE_OBJECT)
static char *
widget_get_id_string (GtkWidget *widget)
@@ -90,14 +88,12 @@ gs_job_class_init (GSJobClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gs_job_finalize;
-
- g_type_class_add_private (klass, sizeof (GSJobPrivate));
}
static void
gs_job_init (GSJob *job)
{
- job->priv = GS_JOB_GET_PRIVATE (job);
+ job->priv = gs_job_get_instance_private (job);
}
/* adapted from gspawn.c */