From bab79c8d63dbe42a6ee3128b3aa55f17fd0dce89 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti de Araujo Date: Mon, 28 Apr 2014 16:15:18 -0700 Subject: updating code to reflect latest powerd dbus API changes --- src/ib-brightness-powerd-control.c | 14 ++++++++------ src/ib-brightness-powerd-control.h | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/ib-brightness-powerd-control.c b/src/ib-brightness-powerd-control.c index 2136fcd..9e8815b 100644 --- a/src/ib-brightness-powerd-control.c +++ b/src/ib-brightness-powerd-control.c @@ -19,8 +19,8 @@ #include "ib-brightness-powerd-control.h" -static gboolean getBrightnessParams(GDBusProxy* powerd_proxy, int *min, int *max, - int *dflt, gboolean *ab_supported); +static gboolean getBrightnessParams(GDBusProxy* powerd_proxy, int *dim, int *min, + int *max, int *dflt, gboolean *ab_supported); GDBusProxy* powerd_get_proxy(brightness_params_t *params) @@ -46,8 +46,8 @@ powerd_get_proxy(brightness_params_t *params) return NULL; } - ret = getBrightnessParams(powerd_proxy, &(params->min), &(params->max), - &(params->dflt), &(params->ab_supported)); + ret = getBrightnessParams(powerd_proxy, &(params->dim), &(params->min), + &(params->max), &(params->dflt), &(params->ab_supported)); if (! ret) { @@ -61,7 +61,7 @@ powerd_get_proxy(brightness_params_t *params) static gboolean -getBrightnessParams(GDBusProxy* powerd_proxy, int *min, int *max, int *dflt, gboolean *ab_supported) +getBrightnessParams(GDBusProxy* powerd_proxy, int *dim, int *min, int *max, int *dflt, gboolean *ab_supported) { GVariant *ret = NULL; GError *error = NULL; @@ -84,7 +84,7 @@ getBrightnessParams(GDBusProxy* powerd_proxy, int *min, int *max, int *dflt, gbo return FALSE; } - g_variant_get(ret, "((iiib))", min, max, dflt, ab_supported); + g_variant_get(ret, "((iiiib))", dim, min, max, dflt, ab_supported); g_variant_unref(ret); return TRUE; } @@ -114,6 +114,7 @@ struct _IbBrightnessPowerdControl GDBusProxy *powerd_proxy; GCancellable *gcancel; + int dim; int min; int max; int dflt; // defalut value @@ -131,6 +132,7 @@ ib_brightness_powerd_control_new (GDBusProxy* powerd_proxy, brightness_params_t control->powerd_proxy = powerd_proxy; control->gcancel = g_cancellable_new(); + control->dim = params.dim; control->min = params.min; control->max = params.max; control->dflt = params.dflt; diff --git a/src/ib-brightness-powerd-control.h b/src/ib-brightness-powerd-control.h index 77f6c8d..95de1f4 100644 --- a/src/ib-brightness-powerd-control.h +++ b/src/ib-brightness-powerd-control.h @@ -23,8 +23,9 @@ #include typedef struct { - int max; + int dim; int min; + int max; int dflt; gboolean ab_supported; } brightness_params_t; -- cgit v1.2.3