- // Deselect the old device, because file type detection in File::create
- // destroys the old session inside libsigrok.
- set_device(shared_ptr<device::DevInst>());
- set_device(shared_ptr<device::DevInst>(device::File::create(name)));
+ _session = _device_manager.context()->load_session(name);
+ _device = _session->devices()[0];
+ _decode_traces.clear();
+ _session->add_datafeed_callback([=]
+ (shared_ptr<Device> device, shared_ptr<Packet> packet) {
+ data_feed_in(device, packet);
+ });
+ _device_manager.update_display_name(_device);
+ update_signals(_device);