网络连接状态改变异常情况处理
This commit is contained in:
parent
bfeb0c2218
commit
56f9c2e4c9
|
@ -681,12 +681,19 @@ void KyNetworkResourceManager::wiredActiveStateChange(QString connectPath,
|
|||
|
||||
void KyNetworkResourceManager::connectActiveStateChange(NetworkManager::Connection::Ptr connectPtr,
|
||||
QString deviceName,
|
||||
KyConnectState state)
|
||||
KyConnectState state, QString activeConnectUuid)
|
||||
{
|
||||
QString uuid = connectPtr->uuid();
|
||||
NetworkManager::ConnectionSettings::Ptr connectSettingsPtr = connectPtr->settings();
|
||||
KyConnectionType connectionType = (KyConnectionType)connectSettingsPtr->connectionType();
|
||||
if (uuid.isEmpty()) {
|
||||
//异常情况处理
|
||||
Q_EMIT wirelessConnectStateChange(deviceName, "", activeConnectUuid, state);
|
||||
Q_EMIT wirelessApConnectStateChange(deviceName, "", activeConnectUuid, state);
|
||||
Q_EMIT wiredConnectStateChange(deviceName, activeConnectUuid, state);
|
||||
return;
|
||||
}
|
||||
|
||||
KyConnectionType connectionType = (KyConnectionType)connectSettingsPtr->connectionType();
|
||||
if (connectionType == CONNECT_TYPE_WIRELESS) {
|
||||
wirelessActiveStateChange(connectSettingsPtr, deviceName, uuid, state);
|
||||
NetworkManager::WirelessSetting::Ptr wirelessSetting
|
||||
|
@ -716,9 +723,10 @@ void KyNetworkResourceManager::onActiveConnectionChanged(
|
|||
NetworkManager::Device:: Ptr devicePtr = findDeviceByUni(ifaceUni);
|
||||
deviceName = devicePtr->interfaceName();
|
||||
}
|
||||
qDebug() << "KyNetworkResourceManager onActiveConnectionChanged" << activeConnect->uuid();
|
||||
|
||||
NetworkManager::Connection::Ptr connectPtr = activeConnect->connection();
|
||||
connectActiveStateChange(connectPtr, deviceName, (KyConnectState)state);
|
||||
connectActiveStateChange(connectPtr, deviceName, (KyConnectState)state, activeConnect->uuid());
|
||||
} else {
|
||||
qWarning() << LOG_FLAG << "onActiveConnectionChanged failed, the connection is invalid.";
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ private:
|
|||
void wiredActiveStateChange(QString connectPath, QString deviceName,
|
||||
QString uuid, KyConnectState state);
|
||||
void connectActiveStateChange(NetworkManager::Connection::Ptr connectPtr,
|
||||
QString deviceName, KyConnectState state);
|
||||
QString deviceName, KyConnectState state, QString activeConnectUuid);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onServiceAppear(QString, QString, QString);
|
||||
|
|
Loading…
Reference in New Issue