Browse Source

devicemanager: device activation

bboozzoo/device-cache
Maciek Borzecki 10 years ago
parent
commit
8db2cc923b
1 changed files with 15 additions and 1 deletions
  1. +15
    -1
      src/devicemanager.vala

+ 15
- 1
src/devicemanager.vala View File

@ -25,10 +25,24 @@ class DeviceManager : GLib.Object
public DeviceManager() {
debug("device manager..");
this.devices = new HashMap<string, Device>();
}
public void found_device(Device dev) {
debug("new device: %s", dev.to_string());
debug("found device: %s", dev.to_string());
string unique = dev.to_unique_string();
if (this.devices.has_key(unique) == false) {
debug("adding new device with key: %s", unique);
this.devices.@set(unique, dev);
dev.activate();
} else {
var known_dev = this.devices.@get(unique);
known_dev.activate_from_device(dev);
}
}
}

Loading…
Cancel
Save