diff options
author | Robert Tari <robert@tari.in> | 2020-09-03 18:43:57 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2020-09-04 19:15:05 +0000 |
commit | 147130a91624079dbc6237d2426f122e0f6513e6 (patch) | |
tree | 3f5f484e69eb1daa45a2e1a4feba003cfbe9f0ed /src/service.c | |
parent | 2849569fffd380b4424278c848e9483e54e4a0c5 (diff) | |
download | ayatana-indicator-power-147130a91624079dbc6237d2426f122e0f6513e6.tar.gz ayatana-indicator-power-147130a91624079dbc6237d2426f122e0f6513e6.tar.bz2 ayatana-indicator-power-147130a91624079dbc6237d2426f122e0f6513e6.zip |
Fix deprecations and build warnings.
Fixes AyatanaIndicators/ayatana-indicator-power#9.
Diffstat (limited to 'src/service.c')
-rw-r--r-- | src/service.c | 14 |
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), |