diff options
author | Ricardo Salveti de Araujo <ricardo.salveti@canonical.com> | 2014-04-28 16:15:18 -0700 |
---|---|---|
committer | Ricardo Salveti de Araujo <ricardo.salveti@canonical.com> | 2014-04-28 16:15:18 -0700 |
commit | bab79c8d63dbe42a6ee3128b3aa55f17fd0dce89 (patch) | |
tree | 22f61b4a686e1d8dacf04686fcf32b0fc1ced7e5 | |
parent | 58ed2f8a5c1b7dd6941adcf8e55f13d1b6706866 (diff) | |
download | ayatana-indicator-power-bab79c8d63dbe42a6ee3128b3aa55f17fd0dce89.tar.gz ayatana-indicator-power-bab79c8d63dbe42a6ee3128b3aa55f17fd0dce89.tar.bz2 ayatana-indicator-power-bab79c8d63dbe42a6ee3128b3aa55f17fd0dce89.zip |
updating code to reflect latest powerd dbus API changes
-rw-r--r-- | src/ib-brightness-powerd-control.c | 14 | ||||
-rw-r--r-- | src/ib-brightness-powerd-control.h | 3 |
2 files changed, 10 insertions, 7 deletions
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 <gio/gio.h> typedef struct { - int max; + int dim; int min; + int max; int dflt; gboolean ab_supported; } brightness_params_t; |