modify:change parameters of network device function.
This commit is contained in:
parent
2ca22019a8
commit
c2a1efa633
|
@ -23,7 +23,9 @@ KyNetworkDeviceResourse::~KyNetworkDeviceResourse()
|
|||
m_networkResourceInstance = nullptr;
|
||||
}
|
||||
|
||||
void KyNetworkDeviceResourse::getNetworkDeviceList(QStringList &networkDeviceList)
|
||||
void KyNetworkDeviceResourse::getNetworkDeviceList(
|
||||
NetworkManager::Device::Type deviceType,
|
||||
QStringList &networkDeviceList)
|
||||
{
|
||||
qDebug()<<"[KyNetworkDeviceResourse]"<<"get device list";
|
||||
NetworkManager::Device::List deviceList
|
||||
|
@ -37,7 +39,9 @@ void KyNetworkDeviceResourse::getNetworkDeviceList(QStringList &networkDeviceLis
|
|||
NetworkManager::Device::Ptr devicePtr = nullptr;
|
||||
for (int index = 0; index < deviceList.size(); ++index) {
|
||||
devicePtr = deviceList.at(index);
|
||||
networkDeviceList<<devicePtr->interfaceName();
|
||||
if (devicePtr->type() == deviceType) {
|
||||
networkDeviceList<<devicePtr->interfaceName();
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
|
@ -14,7 +14,7 @@ public:
|
|||
~KyNetworkDeviceResourse();
|
||||
|
||||
signals:
|
||||
void deviceAdd(QString deviceName);
|
||||
void deviceAdd(QString deviceName, NetworkManager::Device::Type deviceType);
|
||||
void deviceUpdate(QString deviceName);
|
||||
void deviceRemove(QString deviceName);
|
||||
|
||||
|
@ -24,7 +24,7 @@ signals:
|
|||
void deviceMacAddressChanaged(QString deviceName, const QString &hwAddress);
|
||||
|
||||
public:
|
||||
void getNetworkDeviceList(QStringList &networkDeviceList);
|
||||
void getNetworkDeviceList(NetworkManager::Device::Type deviceType, QStringList &networkDeviceList);
|
||||
void getHardwareInfo(QString ifaceName, QString &hardAddress, int &bandWith);
|
||||
NetworkManager::Device::State getDeviceState(QString deviceName);
|
||||
bool wiredDeviceCarriered(QString deviceName);
|
||||
|
|
|
@ -634,7 +634,7 @@ void KyNetworkResourceManager::onDeviceAdded(QString const & uni)
|
|||
|
||||
if (0 > m_devices.indexOf(networkDevice)) {
|
||||
addDevice(networkDevice);
|
||||
emit deviceAdd(networkDevice->interfaceName());
|
||||
emit deviceAdd(networkDevice->interfaceName(), networkDevice->type());
|
||||
} else {
|
||||
qWarning() << networkDevice->interfaceName() <<"the device is exist in network device list.";
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ signals:
|
|||
void connectionUpdate(QString uuid);
|
||||
void connectionRemove(QString path);
|
||||
|
||||
void deviceAdd(QString deviceName);
|
||||
void deviceAdd(QString deviceName, NetworkManager::Device::Type deviceType);
|
||||
void deviceUpdate(NetworkManager::Device * dev);
|
||||
void deviceRemove(QString deviceName);
|
||||
|
||||
|
|
Loading…
Reference in New Issue