[gnome-shell/gnome-41] network: Get dbus path from NMDevice



commit 08d707fbd6765c5002bec4bfdb574e0cadf52576
Author: Xiaoguang Wang <xwang suse com>
Date:   Mon Feb 21 09:11:23 2022 +0800

    network: Get dbus path from NMDevice
    
    In the NetworkManager new version the NMDevice.get_path returns pci
    path, we need to use NM prototype to get device dbus path.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4565
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2194>
    (cherry picked from commit 865581432976941c13a8f19bfc086cba0ddcf241)

 js/ui/status/network.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index a67af20656..79e6a67ea1 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -994,7 +994,7 @@ class NMWirelessDialog extends ModalDialog.ModalDialog {
                 // 802.1x-enabled APs require further configuration, so they're
                 // handled in gnome-control-center
                 launchSettingsPanel('wifi', 'connect-8021x-wifi',
-                    this._device.get_path(), accessPoints[0].get_path());
+                    this._getDeviceDBusPath(), accessPoints[0].get_path());
             } else {
                 let connection = new NM.SimpleConnection();
                 this._client.add_and_activate_connection_async(connection, this._device, 
accessPoints[0].get_path(), null, null);
@@ -1004,6 +1004,11 @@ class NMWirelessDialog extends ModalDialog.ModalDialog {
         this.close();
     }
 
+    _getDeviceDBusPath() {
+        // nm_object_get_path() is shadowed by nm_device_get_path()
+        return NM.Object.prototype.get_path.call(this._device);
+    }
+
     _notifySsidCb(accessPoint) {
         if (accessPoint.get_ssid() != null) {
             accessPoint.disconnect(accessPoint._notifySsidId);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]