Pass char16_t to QString::fromUtf16()

This commit is contained in:
Jonas Kvinge 2020-12-28 20:33:09 +01:00
parent c983c8e447
commit 8ea359ec8a
1 changed files with 1 additions and 5 deletions

View File

@ -591,11 +591,7 @@ void MacOsDeviceLister::USBDeviceAddedCallback(void* refcon, io_iterator_t it) {
// The device actually returned something. That's a good sign.
// Because this was designed by MS, the characters are in UTF-16 (LE?).
// FIXME
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
QString str = QString::fromUtf16(reinterpret_cast<ushort*>(data.data() + 2), (data.size() / 2) - 2);
#pragma GCC diagnostic pop
QString str = QString::fromUtf16(reinterpret_cast<char16_t*>(data.data() + 2), (data.size() / 2) - 2);
if (str.startsWith("MSFT100")) {
// We got the OS descriptor!