summaryrefslogtreecommitdiff
path: root/battstat
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-04-08 11:59:34 +0200
committerRobert Antoni Buj Gelonch <[email protected]>2020-04-16 14:35:58 +0200
commit06ec8896af725b80d9adc7f94699001b0dc23489 (patch)
treee40f741a7cf2ab7946feaf7ba9bf9318959d4031 /battstat
parentea2c6735e3c8a5e5a91e5472123eeaee70716478 (diff)
downloadmate-applets-06ec8896af725b80d9adc7f94699001b0dc23489.tar.bz2
mate-applets-06ec8896af725b80d9adc7f94699001b0dc23489.tar.xz
Remove unused-variable warnings
Diffstat (limited to 'battstat')
-rw-r--r--battstat/battstat-upower.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/battstat/battstat-upower.c b/battstat/battstat-upower.c
index 67779f8c..c22d50c7 100644
--- a/battstat/battstat-upower.c
+++ b/battstat/battstat-upower.c
@@ -79,13 +79,7 @@ device_removed_cb (UpClient *client, const gchar *object_path, gpointer user_dat
char *
battstat_upower_initialise (void (*callback) (void))
{
- char *error_str;
- int i, num;
-
status_updated_callback = callback;
-#if UP_CHECK_VERSION (0, 99, 0)
- GPtrArray *devices;
-#endif
if( upc != NULL )
return g_strdup( "Already initialised!" );
@@ -93,18 +87,18 @@ battstat_upower_initialise (void (*callback) (void))
if( (upc = up_client_new() ) == NULL )
goto error_out;
- GCancellable *cancellable = g_cancellable_new();
- GError *gerror;
-
#if UP_CHECK_VERSION(0, 99, 0)
+ GPtrArray *devices;
devices = up_client_get_devices(upc);
if (!devices) {
goto error_shutdownclient;
}
g_ptr_array_unref(devices);
#else
- if (! up_client_enumerate_devices_sync( upc, cancellable, &gerror ) ) {
- sprintf(error_str, "Unable to enumerate upower devices: %s\n", gerror->message);
+ GError *gerror;
+ GCancellable *cancellable = g_cancellable_new ();
+ if (! up_client_enumerate_devices_sync (upc, cancellable, &gerror)) {
+ g_debug ("Unable to enumerate upower devices: %s\n", gerror->message);
goto error_shutdownclient;
}
#endif
@@ -199,9 +193,6 @@ battstat_upower_get_battery_info( BatteryStatus *status )
*/
int charging = 0;
- /* A list iterator. */
- GSList *item;
-
/* For each physical battery bay... */
int i;
for( i = 0; i < devices->len; i++ )
@@ -211,7 +202,7 @@ battstat_upower_get_battery_info( BatteryStatus *status )
int type, state;
double current_charge, full_capacity, rate;
gint64 time_to_full, time_to_empty;
-
+
g_object_get( upd,
"kind", &type,
"state", &state,