-void DeviceManager::build_display_name(shared_ptr<devices::Device> device)
-{
- const shared_ptr<sigrok::Device> sr_dev = device->device();
- auto session_device = dynamic_pointer_cast<sigrok::SessionDevice>(sr_dev);
- auto hardware_device = dynamic_pointer_cast<sigrok::HardwareDevice>(sr_dev);
-
- if (session_device) {
- full_names_[device] = display_names_[device] =
- boost::filesystem::path(
- session_device->parent()->filename()).filename().string();
- return;
- }
-
- // First, build the device's full name. It always contains all
- // possible information.
- vector<string> parts = {sr_dev->vendor(), sr_dev->model(),
- sr_dev->version(), sr_dev->serial_number()};
-
- if (sr_dev->connection_id().length() > 0)
- parts.push_back("("+sr_dev->connection_id()+")");
-
- full_names_[device] = join(parts, " ");
-
- // Next, build the display name. It only contains fields as required.
-
- // If we can find another device with the same model/vendor then
- // we have at least two such devices and need to distinguish them.
- const bool multiple_dev = hardware_device && any_of(
- devices_.begin(), devices_.end(),
- [&](shared_ptr<devices::HardwareDevice> dev) {
- return (dev->device()->vendor() == hardware_device->vendor() &&
- dev->device()->model() == hardware_device->model()) &&
- dev != device;
- } );
-
- parts = {sr_dev->vendor(), sr_dev->model()};
-
- if (multiple_dev) {
- parts.push_back(sr_dev->version());
- parts.push_back(sr_dev->serial_number());
-
- if ((sr_dev->serial_number().length() == 0) &&
- (sr_dev->connection_id().length() > 0))
- parts.push_back("("+sr_dev->connection_id()+")");
- }
-
- display_names_[device] = join(parts, " ");
-}
-
-const std::string DeviceManager::get_display_name(
- std::shared_ptr<devices::Device> dev)
-{
- return display_names_[dev];
-}
-
-const std::string DeviceManager::get_full_name(
- std::shared_ptr<devices::Device> dev)
-{
- return full_names_[dev];
-}
-
-void DeviceManager::update_display_name(
- std::shared_ptr<devices::Device> dev)
-{
- build_display_name(dev);
-}
-
-bool DeviceManager::compare_devices(
- shared_ptr<devices::Device> a, shared_ptr<devices::Device> b)