Merge branch '0918' into 'yhkylin/v101'
fix(device switch):单网卡开关改为后端新提供的SetStatusDevice接口(#186655) See merge request kylinos-src/kylin-nm!270
This commit is contained in:
commit
923687cf41
|
@ -546,7 +546,24 @@ void KyNetworkDeviceResourse::setDeviceManaged(QString devName, bool managed)
|
|||
qWarning()<<"[KyNetworkDeviceResourse] can not find device " << devName;
|
||||
return;
|
||||
}
|
||||
setDeviceManagedByGDbus(dbusPath, managed);
|
||||
|
||||
QDBusInterface dbusInterface("org.freedesktop.NetworkManager",
|
||||
dbusPath,
|
||||
"org.freedesktop.NetworkManager.Device",
|
||||
QDBusConnection::systemBus());
|
||||
|
||||
if (!dbusInterface.isValid()) {
|
||||
qWarning() << dbusPath << "invalid";
|
||||
setDeviceManagedByGDbus(dbusPath, managed);
|
||||
return;
|
||||
}
|
||||
|
||||
QDBusReply<void> reply = dbusInterface.call("SetStateDevice", "", managed);
|
||||
if (!reply.isValid()) {
|
||||
qWarning() << "SetStateDevice error" << reply.error().message();
|
||||
setDeviceManagedByGDbus(dbusPath, managed);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool KyNetworkDeviceResourse::getDeviceManaged(QString deviceName)
|
||||
|
|
Loading…
Reference in New Issue