Browse Source

application, core: create and track transfer manager

bboozzoo/share-upload
Maciek Borzecki 7 years ago
parent
commit
e232ebc02b
2 changed files with 12 additions and 1 deletions
  1. +10
    -0
      src/mconnect/application.vala
  2. +2
    -1
      src/mconnect/core.vala

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

@ -38,6 +38,8 @@ namespace Mconn {
private Discovery discovery = null;
private DeviceManager manager = null;
private DeviceManagerDBusProxy bus_manager = null;
private TransferManager transfer = null;
private TransferManagerDBusProxy bus_transfer = null;
public Application() {
Object(application_id: "org.mconnect");
@ -45,6 +47,7 @@ namespace Mconn {
discovery = new Discovery();
manager = new DeviceManager();
transfer = new TransferManager();
}
protected override void startup() {
@ -62,6 +65,8 @@ namespace Mconn {
if (core == null)
error("cannot initialize core");
core.transfer_manager = this.transfer;
if (core.config.is_debug_on() == true)
Environment.set_variable("G_MESSAGES_DEBUG", "all", false);
@ -91,6 +96,11 @@ namespace Mconn {
this.bus_manager = new DeviceManagerDBusProxy.with_manager(conn,
this.manager);
this.bus_manager.publish();
this.bus_transfer = new TransferManagerDBusProxy.with_manager(conn,
this.transfer);
this.bus_transfer.publish();
base.dbus_register(conn, object_path);
debug("dbus register, path %s", object_path);


+ 2
- 1
src/mconnect/core.vala View File

@ -29,6 +29,8 @@ class Core : Object {
public Config config { get; private set; default = null; }
public TransferManager transfer_manager { get; set; default = null; }
private static Core _instance = null;
private Core() {
@ -118,5 +120,4 @@ class Core : Object {
return config;
}
}

Loading…
Cancel
Save