From 0819e093d03966df225ebee95f2b11ce70013036 Mon Sep 17 00:00:00 2001 From: Daria Kolodkina Date: Wed, 4 Mar 2026 19:23:45 +0100 Subject: [PATCH 1/3] native: linux: make conversion for logs more transparent Qt build was having a problem with it. --- devlib/native/linux_native.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } } From 8af689908f6bf779ca77c622e717444970cca11c Mon Sep 17 00:00:00 2001 From: Daria Kolodkina Date: Wed, 4 Mar 2026 19:27:19 +0100 Subject: [PATCH 2/3] native: win: QRegExp -> QRegularExpression --- devlib/native/win_native.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/devlib/native/win_native.cpp b/devlib/native/win_native.cpp index f865858..157188b 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,7 +162,7 @@ namespace winutil { static auto extractUSBPorts(QString const& locationPath) { QString ports = ""; - QRegExp usbPort("USB\\((\\d+)"); + QRegularExpression usbPort("USB\\((\\d+)"); int pos = 0; while ((pos = usbPort.indexIn(locationPath, pos)) != -1) { ports += QString(".") + usbPort.cap(1); From 18d0aa77063b42070cd635df9c9d2f290dbaff9a Mon Sep 17 00:00:00 2001 From: Daria Kolodkina Date: Wed, 4 Mar 2026 19:28:15 +0100 Subject: [PATCH 3/3] native: win: change extractUsbPort match cycle This is more clear and proper approach. --- devlib/native/win_native.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/devlib/native/win_native.cpp b/devlib/native/win_native.cpp index 157188b..f3791ee 100644 --- a/devlib/native/win_native.cpp +++ b/devlib/native/win_native.cpp @@ -163,10 +163,10 @@ namespace winutil { static auto extractUSBPorts(QString const& locationPath) { QString ports = ""; QRegularExpression usbPort("USB\\((\\d+)"); - int pos = 0; - while ((pos = usbPort.indexIn(locationPath, pos)) != -1) { - ports += QString(".") + usbPort.cap(1); - pos += usbPort.matchedLength(); + auto it = usbPort.globalMatch(locationPath); + while (it.hasNext()) { + auto match = it.next(); + ports += QString(".") + match.captured(1); } return ports; }