Commit 1a42afef authored by Harald Sitter's avatar Harald Sitter 🐰

usb: parse version from sysfs entries correctly

same format string as on the kernel side.
the previous code would lose trailing zeros because of course .1==.10 but
versions aren't real numbers so that isn't applicable at all.

BUG: 422610
FIXED-IN: 5.19.1
parent eb9a1fe4
......@@ -89,9 +89,8 @@ void USBDevice::parseSysDir(int bus, int parent, int level, const QString& dname
_serial = catFile(dname + QStringLiteral("/serial"));
_channels = catFile(dname + QStringLiteral("/maxchild")).toUInt();
double version = catFile(dname + QStringLiteral("/version")).toDouble();
_verMajor = int(version);
_verMinor = int(10*(version - floor(version)));
const QString version = catFile(dname + QStringLiteral("/version"));
sscanf(qPrintable(version), "%2x.%02x", &_verMajor, &_verMinor);
QDir dir(dname);
dir.setNameFilters(QStringList() << QStringLiteral("%1-*").arg(bus));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment