aboutsummaryrefslogtreecommitdiff
path: root/src/idorange.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-12-03 22:14:51 +0000
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-12-03 22:14:51 +0000
commit0ab4079b28220f4051f8d0935a976e550514ad7f (patch)
tree7693892f4b07f9f222b76d91f641da41f0239d69 /src/idorange.c
parent3fded4665bfe9764faaeb657de791b0c553f6258 (diff)
downloadayatana-ido-0ab4079b28220f4051f8d0935a976e550514ad7f.tar.gz
ayatana-ido-0ab4079b28220f4051f8d0935a976e550514ad7f.tar.bz2
ayatana-ido-0ab4079b28220f4051f8d0935a976e550514ad7f.zip
Avoid deprecated g_type_class_add_private.
Diffstat (limited to 'src/idorange.c')
-rw-r--r--src/idorange.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/idorange.c b/src/idorange.c
index acdfa5d..634b223 100644
--- a/src/idorange.c
+++ b/src/idorange.c
@@ -27,10 +27,9 @@
#include "idotypebuiltins.h"
#include "config.h"
-struct _IdoRangePrivate
-{
+typedef struct {
IdoRangeStyle style;
-};
+} IdoRangePrivate;
static void ido_range_constructed (GObject *object);
static void ido_range_set_property (GObject *object,
@@ -42,9 +41,7 @@ static void ido_range_get_property (GObject *object,
GValue *value,
GParamSpec *pspec);
-#define IDO_RANGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), IDO_TYPE_RANGE, IdoRangePrivate))
-
-G_DEFINE_TYPE (IdoRange, ido_range, GTK_TYPE_SCALE)
+G_DEFINE_TYPE_WITH_PRIVATE (IdoRange, ido_range, GTK_TYPE_SCALE)
enum {
PROP_0,
@@ -87,8 +84,6 @@ ido_range_class_init (IdoRangeClass *class)
G_MAXINT,
8,
G_PARAM_READABLE));
-
- g_type_class_add_private (class, sizeof (IdoRangePrivate));
}
static void
@@ -97,7 +92,8 @@ ido_range_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
- IdoRangePrivate *priv = IDO_RANGE (object)->priv;
+ IdoRange *range = IDO_RANGE (object);
+ IdoRangePrivate *priv = ido_range_get_instance_private (range);
switch (prop_id)
{
@@ -117,7 +113,8 @@ ido_range_set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
- IdoRangePrivate *priv = IDO_RANGE (object)->priv;
+ IdoRange *range = IDO_RANGE (object);
+ IdoRangePrivate *priv = ido_range_get_instance_private (range);
switch (prop_id)
{
@@ -135,6 +132,7 @@ static void
ido_range_constructed (GObject *object)
{
IdoRange *range = IDO_RANGE (object);
+
IdoRangeStyle style;
char buf[1024];
@@ -163,7 +161,7 @@ ido_range_constructed (GObject *object)
static void
ido_range_init (IdoRange *range)
{
- range->priv = IDO_RANGE_GET_PRIVATE (range);
+ /* no-op */
}
/**