X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdevices%2Fhardwaredevice.cpp;h=a3d84d6fadf175973fab3a2a420f190838948fc2;hp=0ed5c4ae3ee4cb5f6339505c9e640c03ab3fe69c;hb=f4ab4b5c657e5613caba82feaa81a8a400e4f331;hpb=6f925ba9d6faf1077b73c5a5808259576081716a diff --git a/pv/devices/hardwaredevice.cpp b/pv/devices/hardwaredevice.cpp index 0ed5c4a..a3d84d6 100644 --- a/pv/devices/hardwaredevice.cpp +++ b/pv/devices/hardwaredevice.cpp @@ -27,7 +27,6 @@ #include "hardwaredevice.hpp" -using std::dynamic_pointer_cast; using std::shared_ptr; using std::static_pointer_cast; using std::string; @@ -55,8 +54,15 @@ HardwareDevice::~HardwareDevice() string HardwareDevice::full_name() const { - vector parts = {device_->vendor(), device_->model(), - device_->version(), device_->serial_number()}; + vector parts = {}; + if (device_->vendor().length() > 0) + parts.push_back(device_->vendor()); + if (device_->model().length() > 0) + parts.push_back(device_->model()); + if (device_->version().length() > 0) + parts.push_back(device_->version()); + if (device_->serial_number().length() > 0) + parts.push_back("[S/N: " + device_->serial_number() + "]"); if (device_->connection_id().length() > 0) parts.push_back("(" + device_->connection_id() + ")"); return join(parts, " "); @@ -85,11 +91,17 @@ string HardwareDevice::display_name( dev->device_ != device_; }); - vector parts = {device_->vendor(), device_->model()}; + vector parts = {}; + if (device_->vendor().length() > 0) + parts.push_back(device_->vendor()); + if (device_->model().length() > 0) + parts.push_back(device_->model()); if (multiple_dev) { - parts.push_back(device_->version()); - parts.push_back(device_->serial_number()); + if (device_->version().length() > 0) + parts.push_back(device_->version()); + if (device_->serial_number().length() > 0) + parts.push_back("[S/N: " + device_->serial_number() + "]"); if ((device_->serial_number().length() == 0) && (device_->connection_id().length() > 0))