← Back to team overview

ubuntuforums-unanswered team mailing list archive

Re: [Question #78762]: How do I ask devicekit-power what devices are available?

 

Question #78762 on devicekit-power in ubuntu changed:
https://answers.edge.launchpad.net/ubuntu/+source/devicekit-power/+question/78762

    Status: Open => Solved

Scott Howard confirmed that the question is solved:
engine->priv->array

is the array of devices, no need to do calls to dbus, just go through
that and see if any are of the type you need

for (i=0;i<array->len;i++) {
		device = g_ptr_array_index (engine->priv->array, i);
                check to see if device->private->type is > 1
                If it is, use "Laptop Battery"
                If it isn't, use "Battery"
}

-- 
You received this question notification because you are a member of UF
Unanswered Posts Team, which is an answer contact for Ubuntu.