From 905ec4a10feca9f26bc5e969f3acd02b87135ca9 Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Mon, 11 Sep 2023 10:41:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(kylin-nm):=E8=8E=B7=E5=8F=96=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E7=BD=91=E5=AF=86=E7=A0=81=E5=A2=9E=E5=8A=A0=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E6=97=B6=E9=97=B4500ms(#191241)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kywirelessconnectoperation.cpp | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/backend/dbus-interface/kywirelessconnectoperation.cpp b/src/backend/dbus-interface/kywirelessconnectoperation.cpp index 95464fe6..4a1cc199 100644 --- a/src/backend/dbus-interface/kywirelessconnectoperation.cpp +++ b/src/backend/dbus-interface/kywirelessconnectoperation.cpp @@ -455,8 +455,15 @@ QString KyWirelessConnectOperation::getPrivateKeyPassword(const QString &connect qWarning()< reply = connectPtr->secrets(PRIVATE_PSK_SETTING_NAME); - QMap map(reply.value()); + QDBusInterface dbusInterface("org.freedesktop.NetworkManager", + connectPtr->path(), + "org.freedesktop.NetworkManager.Settings.Connection", + QDBusConnection::systemBus()); + dbusInterface.setTimeout(500); + QDBusMessage result = dbusInterface.call("GetSecrets", PRIVATE_PSK_SETTING_NAME); + const QDBusArgument &dbusArg1st = result.arguments().at( 0 ).value(); + QMap map; + dbusArg1st >> map; if (map.contains("802-1x") && map.value("802-1x").contains("private-key-password")) { QString psk = map.value("802-1x").value("private-key-password").toString(); @@ -475,8 +482,19 @@ QString KyWirelessConnectOperation::get8021xPassword(const QString &connectUuid) qWarning()< reply = connectPtr->secrets(PRIVATE_PSK_SETTING_NAME); - QMap map(reply.value()); + + QDBusInterface dbusInterface("org.freedesktop.NetworkManager", + connectPtr->path(), + "org.freedesktop.NetworkManager.Settings.Connection", + QDBusConnection::systemBus()); + dbusInterface.setTimeout(500); + QDBusMessage result = dbusInterface.call("GetSecrets", PRIVATE_PSK_SETTING_NAME); + const QDBusArgument &dbusArg1st = result.arguments().at( 0 ).value(); + QMap map; + dbusArg1st >> map; + +// QDBusPendingReply reply = connectPtr->secrets(PRIVATE_PSK_SETTING_NAME); +// QMap map(reply.value()); if (map.contains("802-1x") && map.value("802-1x").contains("password")) { QString psk = map.value("802-1x").value("password").toString();