aboutsummaryrefslogtreecommitdiff
path: root/src/service.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-09-04 21:17:12 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-09-04 21:17:12 +0200
commit527bbe441c788bae626637d7c75b0603d08eceb4 (patch)
tree3f5f484e69eb1daa45a2e1a4feba003cfbe9f0ed /src/service.c
parentca5a779dc20a5d33249a9298eb1ec834e63ecdee (diff)
parent147130a91624079dbc6237d2426f122e0f6513e6 (diff)
downloadayatana-indicator-power-527bbe441c788bae626637d7c75b0603d08eceb4.tar.gz
ayatana-indicator-power-527bbe441c788bae626637d7c75b0603d08eceb4.tar.bz2
ayatana-indicator-power-527bbe441c788bae626637d7c75b0603d08eceb4.zip
Merge branch 'tari01-pr/deprecations-warnings'
Attributes GH PR #14: https://github.com/AyatanaIndicators/ayatana-indicator-power/pull/14
Diffstat (limited to 'src/service.c')
-rw-r--r--src/service.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/service.c b/src/service.c
index c7aec9e..cc4e9aa 100644
--- a/src/service.c
+++ b/src/service.c
@@ -37,10 +37,6 @@
#define SETTINGS_ICON_POLICY_S "icon-policy"
#define SETTINGS_SHOW_PERCENTAGE_S "show-percentage"
-G_DEFINE_TYPE (IndicatorPowerService,
- indicator_power_service,
- G_TYPE_OBJECT)
-
enum
{
SIGNAL_NAME_LOST,
@@ -129,6 +125,8 @@ struct _IndicatorPowerServicePrivate
typedef IndicatorPowerServicePrivate priv_t;
+G_DEFINE_TYPE_WITH_PRIVATE(IndicatorPowerService, indicator_power_service, G_TYPE_OBJECT)
+
/***
****
**** DEVICES
@@ -967,7 +965,7 @@ on_bus_acquired (GDBusConnection * connection,
g_debug ("bus acquired: %s", name);
- p->conn = g_object_ref (G_OBJECT (connection));
+ p->conn = (GDBusConnection*)g_object_ref(G_OBJECT (connection));
g_object_notify_by_pspec (G_OBJECT(self), properties[PROP_BUS]);
/* export the battery properties */
@@ -1188,9 +1186,7 @@ indicator_power_service_init (IndicatorPowerService * self)
priv_t * p;
int i;
- p = G_TYPE_INSTANCE_GET_PRIVATE (self,
- INDICATOR_TYPE_POWER_SERVICE,
- IndicatorPowerServicePrivate);
+ p = indicator_power_service_get_instance_private(self);
self->priv = p;
p->cancellable = g_cancellable_new ();
@@ -1233,8 +1229,6 @@ indicator_power_service_class_init (IndicatorPowerServiceClass * klass)
object_class->get_property = my_get_property;
object_class->set_property = my_set_property;
- g_type_class_add_private (klass, sizeof (IndicatorPowerServicePrivate));
-
signals[SIGNAL_NAME_LOST] = g_signal_new (
INDICATOR_POWER_SERVICE_SIGNAL_NAME_LOST,
G_TYPE_FROM_CLASS(klass),