settings.setValue("device_type", "hardware");
settings.beginGroup("device");
- key_list.push_back("vendor");
- key_list.push_back("model");
- key_list.push_back("version");
- key_list.push_back("serial_num");
- key_list.push_back("connection_id");
+ key_list.emplace_back("vendor");
+ key_list.emplace_back("model");
+ key_list.emplace_back("version");
+ key_list.emplace_back("serial_num");
+ key_list.emplace_back("connection_id");
dev_info = device_manager_.get_device_info(device_);
// Re-select last used device if possible but only if it's not demo
settings.beginGroup("device");
- key_list.push_back("vendor");
- key_list.push_back("model");
- key_list.push_back("version");
- key_list.push_back("serial_num");
- key_list.push_back("connection_id");
+ key_list.emplace_back("vendor");
+ key_list.emplace_back("model");
+ key_list.emplace_back("version");
+ key_list.emplace_back("serial_num");
+ key_list.emplace_back("connection_id");
for (string key : key_list) {
const QString k = QString::fromStdString(key);
for (const shared_ptr<data::SignalData> d : all_signal_data_)
d->clear();
- // Revert name back to default name (e.g. "Session 1") as the data is gone
- name_ = default_name_;
- name_changed();
+ // Revert name back to default name (e.g. "Session 1") for real devices
+ // as the (possibly saved) data is gone. File devices keep their name.
+ shared_ptr<devices::HardwareDevice> hw_device =
+ dynamic_pointer_cast< devices::HardwareDevice >(device_);
+
+ if (hw_device) {
+ name_ = default_name_;
+ name_changed();
+ }
// Begin the session
sampling_thread_ = std::thread(