Skip to content

Commit

Permalink
Allways inline QString::toStdWString
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Nov 18, 2015
1 parent c59b8f4 commit 67d56f5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/controllers/hid/hidcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,15 @@ QString safeDecodeWideString(const wchar_t* pStr, size_t max_length) {
while ((size < (int)max_length) && (pStr[size] != 0)) {
++size;
}
#ifdef __WINDOWS__
// We cannot use Qts wchar_t functions, since the may work or not
// inlining QString::fromWCharArray()
// We cannot use Qts wchar_t functions, since they may work or not
// depending on the '/Zc:wchar_t-' build flag in the Qt configs
// on Windows build
if (sizeof(wchar_t) == sizeof(QChar)) {
return QString::fromUtf16((const ushort *)pStr, size);
} else {
return QString::fromUcs4((uint *)pStr, size);
}
#else
return QString::fromWCharArray(pStr, size);
#endif
}

HidController::HidController(const hid_device_info deviceInfo)
Expand Down

0 comments on commit 67d56f5

Please sign in to comment.