| 43 | } |
| 44 | |
| 45 | float KbManager::parseVersionString(QString version){ |
| 46 | // Remove extraneous info (anything after a +, anything non-numeric) |
| 47 | QStringList dots = version.replace(QRegExp("\\+.+"), "").replace(QRegExp("[^\\d\\.]"), "").split("."); |
| 48 | float base = 1.f; |
| 49 | float res = 0.f; |
| 50 | // A number like "1.2.3" will result in 1.0203 |
| 51 | // NB: will fail if a point version goes over 99 or if using more than two dots. floats can only reliably encode 7 decimal digits. |
| 52 | foreach(const QString& dot, dots){ |
| 53 | res += dot.toFloat() * base; |
| 54 | base /= 100.f; |
| 55 | } |
| 56 | return res; |
| 57 | } |
| 58 | |
| 59 | void KbManager::scanKeyboards(){ |
| 60 | QString rootdev = devpath.arg(0); |
nothing calls this directly
no outgoing calls
no test coverage detected