summaryrefslogtreecommitdiff
path: root/libupower-glib
diff options
context:
space:
mode:
authorChristian Kellner <christian@kellner.me>2019-02-20 17:47:45 +0100
committerChristian Kellner <christian@kellner.me>2019-02-21 12:07:59 +0100
commit8da188b30351a252de2405b09698dd61d53eb606 (patch)
tree770c8d56386e406aa69bb1cf4b3cb83f1b7db773 /libupower-glib
parent2a9598372c57429e07b91c4a1a05e29cca2aee94 (diff)
downloadupower-8da188b30351a252de2405b09698dd61d53eb606.tar.gz
Replace use of deprecated g_type_class_add_private
Use G_DEFINE_TYPE_WITH_CODE (..., G_PRIVATE_ADD (...)) instead of the (deprecated since glib 2.58) function g_type_class_add_private to add a private structure for a type. Bump the minimal required version of glib to 2.38.0, the version where G_PRIVATE_ADD was added.
Diffstat (limited to 'libupower-glib')
-rw-r--r--libupower-glib/up-client.c3
-rw-r--r--libupower-glib/up-device.c4
-rw-r--r--libupower-glib/up-history-item.c4
-rw-r--r--libupower-glib/up-stats-item.c4
-rw-r--r--libupower-glib/up-wakeup-item.c4
-rw-r--r--libupower-glib/up-wakeups.c4
6 files changed, 6 insertions, 17 deletions
diff --git a/libupower-glib/up-client.c b/libupower-glib/up-client.c
index 1491a98..2309bd3 100644
--- a/libupower-glib/up-client.c
+++ b/libupower-glib/up-client.c
@@ -73,6 +73,7 @@ enum {
static guint signals [UP_CLIENT_LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE_WITH_CODE (UpClient, up_client, G_TYPE_OBJECT,
+ G_ADD_PRIVATE(UpClient)
G_IMPLEMENT_INTERFACE(G_TYPE_INITABLE, up_client_initable_iface_init))
/**
@@ -451,8 +452,6 @@ up_client_class_init (UpClientClass *klass)
G_STRUCT_OFFSET (UpClientClass, device_removed),
NULL, NULL, g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1, G_TYPE_STRING);
-
- g_type_class_add_private (klass, sizeof (UpClientPrivate));
}
/*
diff --git a/libupower-glib/up-device.c b/libupower-glib/up-device.c
index 2f2c4cf..6a4a4ad 100644
--- a/libupower-glib/up-device.c
+++ b/libupower-glib/up-device.c
@@ -94,7 +94,7 @@ enum {
PROP_LAST
};
-G_DEFINE_TYPE (UpDevice, up_device, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (UpDevice, up_device, G_TYPE_OBJECT)
/*
* up_device_changed_cb:
@@ -1202,8 +1202,6 @@ up_device_class_init (UpDeviceClass *klass)
g_param_spec_string ("icon-name",
NULL, NULL, NULL,
G_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (UpDevicePrivate));
}
static void
diff --git a/libupower-glib/up-history-item.c b/libupower-glib/up-history-item.c
index 19f4c5d..0fbefa6 100644
--- a/libupower-glib/up-history-item.c
+++ b/libupower-glib/up-history-item.c
@@ -56,7 +56,7 @@ enum {
PROP_LAST
};
-G_DEFINE_TYPE (UpHistoryItem, up_history_item, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (UpHistoryItem, up_history_item, G_TYPE_OBJECT)
/**
* up_history_item_set_value:
@@ -321,8 +321,6 @@ up_history_item_class_init (UpHistoryItemClass *klass)
0, G_MAXUINT,
UP_DEVICE_STATE_UNKNOWN,
G_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (UpHistoryItemPrivate));
}
/**
diff --git a/libupower-glib/up-stats-item.c b/libupower-glib/up-stats-item.c
index 555aa3a..c0204bf 100644
--- a/libupower-glib/up-stats-item.c
+++ b/libupower-glib/up-stats-item.c
@@ -53,7 +53,7 @@ enum {
PROP_LAST
};
-G_DEFINE_TYPE (UpStatsItem, up_stats_item, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (UpStatsItem, up_stats_item, G_TYPE_OBJECT)
/**
* up_stats_item_set_value:
@@ -193,8 +193,6 @@ up_stats_item_class_init (UpStatsItemClass *klass)
g_param_spec_double ("accuracy", NULL, NULL,
0.0, G_MAXDOUBLE, 0.0,
G_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (UpStatsItemPrivate));
}
/**
diff --git a/libupower-glib/up-wakeup-item.c b/libupower-glib/up-wakeup-item.c
index cefbe62..948e4a1 100644
--- a/libupower-glib/up-wakeup-item.c
+++ b/libupower-glib/up-wakeup-item.c
@@ -61,7 +61,7 @@ enum {
PROP_LAST
};
-G_DEFINE_TYPE (UpWakeupItem, up_wakeup_item, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (UpWakeupItem, up_wakeup_item, G_TYPE_OBJECT)
/**
* up_wakeup_item_get_is_userspace:
@@ -409,8 +409,6 @@ up_wakeup_item_class_init (UpWakeupItemClass *klass)
g_param_spec_string ("details", NULL, NULL,
NULL,
G_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (UpWakeupItemPrivate));
}
/**
diff --git a/libupower-glib/up-wakeups.c b/libupower-glib/up-wakeups.c
index 400aedc..630df82 100644
--- a/libupower-glib/up-wakeups.c
+++ b/libupower-glib/up-wakeups.c
@@ -47,7 +47,7 @@ enum {
static guint signals [UP_WAKEUPS_LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (UpWakeups, up_wakeups, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (UpWakeups, up_wakeups, G_TYPE_OBJECT)
/**
* up_wakeups_get_total_sync:
@@ -233,8 +233,6 @@ up_wakeups_class_init (UpWakeupsClass *klass)
G_STRUCT_OFFSET (UpWakeupsClass, data_changed),
NULL, NULL, g_cclosure_marshal_VOID__UINT,
G_TYPE_NONE, 1, G_TYPE_UINT);
-
- g_type_class_add_private (klass, sizeof (UpWakeupsPrivate));
}
/**