Browse Source

application, devicemanager: restore devices from cache when application becomes active

bboozzoo/dbus-support-interfaces
Maciek Borzecki 8 years ago
parent
commit
1e664bf8af
2 changed files with 4 additions and 5 deletions
  1. +2
    -0
      src/mconnect/application.vala
  2. +2
    -5
      src/mconnect/devicemanager.vala

+ 2
- 0
src/mconnect/application.vala View File

@ -71,6 +71,8 @@ namespace Mconn {
protected override void activate() {
debug("activate");
// reload devices from cache
manager.load_cache();
hold();
}


+ 2
- 5
src/mconnect/devicemanager.vala View File

@ -44,10 +44,6 @@ class DeviceManager : GLib.Object
debug("device manager..");
this.devices = new HashMap<string, Device>();
// TODO: check for network connectivity first, possibly pass
// this through the main loop
load_cache();
}
/**
@ -68,7 +64,8 @@ class DeviceManager : GLib.Object
/**
* Load known devices from cache and attempt pairing.
*/
private void load_cache() {
[DBus (visible = false)]
public void load_cache() {
debug("try loading devices from device cache");
var cache_file = get_cache_file();


Loading…
Cancel
Save