diff --git a/devlib/native/linux_native.cpp b/devlib/native/linux_native.cpp index 979ec75..72913a8 100644 --- a/devlib/native/linux_native.cpp +++ b/devlib/native/linux_native.cpp @@ -51,7 +51,7 @@ namespace linutil { if (::close(fd) == -1) { auto errnoCache = errno; linutil::errnoWarning(__PRETTY_FUNCTION__, - QString("can not close handle ").append(fd), + QString("can not close handle ").append(QString::number(fd)), errnoCache); } } diff --git a/devlib/native/win_native.cpp b/devlib/native/win_native.cpp index f865858..f3791ee 100644 --- a/devlib/native/win_native.cpp +++ b/devlib/native/win_native.cpp @@ -14,6 +14,7 @@ #include #include +#include namespace winutil { Q_LOGGING_CATEGORY(winlog, "windows_native"); @@ -161,11 +162,11 @@ namespace winutil { static auto extractUSBPorts(QString const& locationPath) { QString ports = ""; - QRegExp usbPort("USB\\((\\d+)"); - int pos = 0; - while ((pos = usbPort.indexIn(locationPath, pos)) != -1) { - ports += QString(".") + usbPort.cap(1); - pos += usbPort.matchedLength(); + QRegularExpression usbPort("USB\\((\\d+)"); + auto it = usbPort.globalMatch(locationPath); + while (it.hasNext()) { + auto match = it.next(); + ports += QString(".") + match.captured(1); } return ports; }