feat: Add get network message by device name.

This commit is contained in:
sunwen
2025-07-22 11:11:25 +08:00
parent 753aebd35c
commit a6ca8c66ac

View File

@@ -57,7 +57,7 @@ void NetworkManager::initNetworkInfo()
QList<QNetworkInterface> interfaces = QNetworkInterface::allInterfaces();
for (const QNetworkInterface &interface : interfaces)
{
if (!(interface.flags() & QNetworkInterface::IsLoopBack))
if (!(interface.flags() & QNetworkInterface::IsLoopBack) && interface.name() == mDeviceName)
{
QList<QNetworkAddressEntry> entries = interface.addressEntries();
for (const QNetworkAddressEntry &entry : entries)