+ // First, build the device's full name. It always contains all
+ // possible information.
+ vector<string> parts = {device->vendor(), device->model(),
+ device->version(), device->serial_number()};
+
+ if (device->connection_id().length() > 0)
+ parts.push_back("("+device->connection_id()+")");
+
+ for (size_t i = 0; i < parts.size(); i++)
+ {
+ if (parts[i].length() > 0)
+ {
+ if (i != 0)
+ s << " ";
+ s << parts[i];
+ }
+ }
+
+ full_names_[device] = s.str();
+
+ // Next, build the display name. It only contains fields as required.