]> sigrok.org Git - pulseview.git/commitdiff
HardwareDevice: Make serial number display a bit clearer.
authorUwe Hermann <redacted>
Tue, 24 Jul 2018 19:35:26 +0000 (21:35 +0200)
committerUwe Hermann <redacted>
Tue, 24 Jul 2018 20:09:46 +0000 (22:09 +0200)
pv/devices/hardwaredevice.cpp

index ff52f817327d6d0d5790c91675e764d1d6091212..50cab7b09b7c6f2c63c63549c57f5491297baceb 100644 (file)
@@ -55,7 +55,9 @@ HardwareDevice::~HardwareDevice()
 string HardwareDevice::full_name() const
 {
        vector<string> parts = {device_->vendor(), device_->model(),
-               device_->version(), device_->serial_number()};
+               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, " ");
@@ -88,7 +90,7 @@ string HardwareDevice::display_name(
 
        if (multiple_dev) {
                parts.push_back(device_->version());
-               parts.push_back(device_->serial_number());
+               parts.push_back("[S/N: " + device_->serial_number() + "]");
 
                if ((device_->serial_number().length() == 0) &&
                        (device_->connection_id().length() > 0))