Skip to content

Commit 964bb59

Browse files
committed
Fix error in hardware key detection code on Windows
1 parent 5acfcc6 commit 964bb59

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/gui/osutils/winutils/DeviceListenerWin.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ void DeviceListenerWin::registerHotplugCallback(bool arrived,
5656
regex += QString("PID_%1&").arg(productId, 0, 16).toUpper();
5757
}
5858
}
59-
regex += QString(".*$"); // Qt won't match otherwise
6059
m_deviceIdMatch = QRegularExpression(regex);
6160

6261
DEV_BROADCAST_DEVICEINTERFACE_W notificationFilter{
@@ -95,7 +94,7 @@ bool DeviceListenerWin::nativeEventFilter(const QByteArray& eventType, void* mes
9594
|| (m_handleRemoval && m->wParam == DBT_DEVICEREMOVECOMPLETE)) {
9695
const auto pBrHdr = reinterpret_cast<PDEV_BROADCAST_HDR>(m->lParam);
9796
const auto pDevIface = reinterpret_cast<PDEV_BROADCAST_DEVICEINTERFACE_W>(pBrHdr);
98-
const auto name = QString::fromWCharArray(pDevIface->dbcc_name, pDevIface->dbcc_size);
97+
const auto name = QString::fromWCharArray(pDevIface->dbcc_name);
9998
if (m_deviceIdMatch.match(name).hasMatch()) {
10099
emit devicePlugged(m->wParam == DBT_DEVICEARRIVAL, nullptr, pDevIface);
101100
return true;

0 commit comments

Comments
 (0)