Skip to content
  • Christian Kandeler's avatar
    Device support: Make it easier to change the device state. · a0f3eeac
    Christian Kandeler authored
    
    
    For auto-detected devices, it is reasonable to assume that their state
    changes from time to time, e.g. because a USB cable is unplugged.
    Currently, whoever is responsible for syncing actual device state
    to the one in the DeviceManager has to do the following:
        1. Get the IDevice from the DeviceManager.
        2. Clone it.
        3. Change the state in the copy.
        4. Re-add it to the DeviceManager, where the current object is
           being replaced (and another copy is made).
    This is rather clumsy and unintuitive. Therefore, we now provide
    DeviceManager::setDeviceState(), which turns the above into a one-liner
    for client code and does not involve any copying.
    
    Change-Id: Ic9f27e5c9f33c2b3a2f6de1976f12df1e78baf2e
    Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
    a0f3eeac