Changeset View
Changeset View
Standalone View
Standalone View
src/edid.cpp
Show First 20 Lines • Show All 400 Lines • ▼ Show 20 Line(s) | 396 | { | |||
---|---|---|---|---|---|
401 | for (i = 0; i < 10; ++i) { | 401 | for (i = 0; i < 10; ++i) { | ||
402 | result += edidGetBit(high, i) * pow(2, i - 10); | 402 | result += edidGetBit(high, i) * pow(2, i - 10); | ||
403 | } | 403 | } | ||
404 | return result; | 404 | return result; | ||
405 | } | 405 | } | ||
406 | 406 | | |||
407 | QString Edid::Private::edidParseString(const quint8 *data) const | 407 | QString Edid::Private::edidParseString(const quint8 *data) const | ||
408 | { | 408 | { | ||
409 | QString text; | | |||
410 | | ||||
411 | /* this is always 12 bytes, but we can't guarantee it's null | 409 | /* this is always 12 bytes, but we can't guarantee it's null | ||
412 | * terminated or not junk. */ | 410 | * terminated or not junk. */ | ||
413 | text = QString::fromLocal8Bit(reinterpret_cast<const char*>(data), 12); | 411 | auto text = QString::fromLocal8Bit(reinterpret_cast<const char*>(data), 12); | ||
414 | 412 | | |||
415 | // Remove newlines, extra spaces and stuff | 413 | // Remove newlines, extra spaces and stuff | ||
416 | text = text.simplified(); | 414 | return text.simplified(); | ||
417 | | ||||
418 | return text; | | |||
419 | } | 415 | } |