summaryrefslogtreecommitdiff
path: root/src/openbsd/up-backend.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2013-10-11 15:23:25 +0200
committerBastien Nocera <hadess@hadess.net>2013-10-14 10:42:56 +0200
commitbd3a57fe0471ddeb8f0a168f10629e8f5d7b7b6c (patch)
treeb5fd4e86161aa8eaf9c9f7eb395ba054d663e447 /src/openbsd/up-backend.c
parent9c27c42a9977afe6e82622bda947b831c3be7197 (diff)
downloadupower-bd3a57fe0471ddeb8f0a168f10629e8f5d7b7b6c.tar.gz
daemon: Replace "on-low-battery" property
With "warning-level" property.
Diffstat (limited to 'src/openbsd/up-backend.c')
-rw-r--r--src/openbsd/up-backend.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/src/openbsd/up-backend.c b/src/openbsd/up-backend.c
index c8f75ea..b6bd001 100644
--- a/src/openbsd/up-backend.c
+++ b/src/openbsd/up-backend.c
@@ -36,7 +36,6 @@ UpDeviceState up_backend_apm_get_battery_state_value(u_char battery_state);
static void up_backend_update_acpibat_state(UpDevice*, struct sensordev);
static gboolean up_apm_device_get_on_battery (UpDevice *device, gboolean *on_battery);
-static gboolean up_apm_device_get_low_battery (UpDevice *device, gboolean *low_battery);
static gboolean up_apm_device_get_online (UpDevice *device, gboolean *online);
static gboolean up_apm_device_refresh (UpDevice *device);
@@ -92,28 +91,6 @@ up_apm_device_get_on_battery (UpDevice *device, gboolean * on_battery)
*on_battery = (state == UP_DEVICE_STATE_DISCHARGING);
return TRUE;
}
-gboolean
-up_apm_device_get_low_battery (UpDevice *device, gboolean * low_battery)
-{
- gboolean ret;
- gboolean on_battery;
- gdouble percentage;
-
- g_return_val_if_fail (low_battery != NULL, FALSE);
-
- ret = up_apm_device_get_on_battery (device, &on_battery);
- if (!ret)
- return FALSE;
-
- if (!on_battery) {
- *low_battery = FALSE;
- return TRUE;
- }
-
- g_object_get (device, "percentage", &percentage, (void*) NULL);
- *low_battery = (percentage < 10.0f);
- return TRUE;
-}
gboolean
up_apm_device_get_online (UpDevice *device, gboolean * online)
@@ -509,12 +486,10 @@ up_backend_init (UpBackend *backend)
backend->priv->battery = UP_DEVICE(up_device_new ());
device_class = UP_DEVICE_GET_CLASS (backend->priv->battery);
device_class->get_on_battery = up_apm_device_get_on_battery;
- device_class->get_low_battery = up_apm_device_get_low_battery;
device_class->get_online = up_apm_device_get_online;
device_class->refresh = up_apm_device_refresh;
device_class = UP_DEVICE_GET_CLASS (backend->priv->ac);
device_class->get_on_battery = up_apm_device_get_on_battery;
- device_class->get_low_battery = up_apm_device_get_low_battery;
device_class->get_online = up_apm_device_get_online;
device_class->refresh = up_apm_device_refresh;
/* creates thread */