projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
88fc056
)
DeviceManager: Minor tidyup in build_display_name
author
Joel Holdsworth
<joel@airwebreathe.org.uk>
Sat, 13 Dec 2014 10:16:17 +0000
(10:16 +0000)
committer
Joel Holdsworth
<joel@airwebreathe.org.uk>
Sat, 13 Dec 2014 10:16:17 +0000
(10:16 +0000)
pv/devicemanager.cpp
patch
|
blob
|
history
diff --git
a/pv/devicemanager.cpp
b/pv/devicemanager.cpp
index 7cb90bb8b9b8d9a964883b6f53d31c93071bbf3b..0c6c354fe6f12e14c06a7cfa955464b8049f4088 100644
(file)
--- a/
pv/devicemanager.cpp
+++ b/
pv/devicemanager.cpp
@@
-209,17
+209,16
@@
void DeviceManager::build_display_name(shared_ptr<Device> device)
full_names_[device] = join(parts, " ");
// Next, build the display name. It only contains fields as required.
full_names_[device] = join(parts, " ");
// Next, build the display name. It only contains fields as required.
- bool multiple_dev = false;
// If we can find another device with the same model/vendor then
// we have at least two such devices and need to distinguish them.
// If we can find another device with the same model/vendor then
// we have at least two such devices and need to distinguish them.
- if (hardware_device)
-
multiple_dev = any_of(
devices_.begin(), devices_.end(),
-
[&](shared_ptr<HardwareDevice> dev) {
+ const bool multiple_dev = hardware_device && any_of(
+ devices_.begin(), devices_.end(),
+ [&](shared_ptr<HardwareDevice> dev) {
return (dev->vendor() == hardware_device->vendor() &&
return (dev->vendor() == hardware_device->vendor() &&
- dev->model() == hardware_device->model()) &&
- dev != hardware_device;
-
} );
+
dev->model() == hardware_device->model()) &&
+
dev != hardware_device;
+ } );
parts = {device->vendor(), device->model()};
parts = {device->vendor(), device->model()};