C++: Add spaces in Device::description().
This commit is contained in:
parent
d1075e5acf
commit
584f76a78a
|
@ -442,16 +442,20 @@ string Device::description()
|
||||||
ostringstream s;
|
ostringstream s;
|
||||||
|
|
||||||
vector<string> parts =
|
vector<string> parts =
|
||||||
{vendor(), model(), version()};
|
{vendor(), model(), version(), serial_number()};
|
||||||
|
|
||||||
for (string part : parts)
|
for (size_t i = 0; i < parts.size(); i++)
|
||||||
if (part.length() > 0)
|
{
|
||||||
s << part;
|
if (parts[i].length() > 0)
|
||||||
|
{
|
||||||
|
if (i != 0)
|
||||||
|
s << " ";
|
||||||
|
s << parts[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (serial_number().length() > 0)
|
if (serial_number().length() == 0 && connection_id().length() > 0)
|
||||||
s << serial_number();
|
s << " " << connection_id();
|
||||||
else
|
|
||||||
s << connection_id();
|
|
||||||
|
|
||||||
return s.str();
|
return s.str();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue