[gnome-shell/gnome-3-14] networkAgent: Support NM versions without :capabilities



commit e21e90c5e6fbf788a17f252f0e1c30ec880a59bf
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Oct 31 12:33:22 2014 +0000

    networkAgent: Support NM versions without :capabilities
    
    Commit 926de53c0cbd7ae5 bumped the requirement for NetworkManager,
    which is problematic on a stable branch; optionally fall back to
    the previous code.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=738485

 js/ui/components/networkAgent.js |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/components/networkAgent.js b/js/ui/components/networkAgent.js
index 2a3412d..2d8d715 100644
--- a/js/ui/components/networkAgent.js
+++ b/js/ui/components/networkAgent.js
@@ -604,9 +604,15 @@ const NetworkAgent = new Lang.Class({
     Name: 'NetworkAgent',
 
     _init: function() {
-        this._native = new Shell.NetworkAgent({ identifier: 'org.gnome.Shell.NetworkAgent',
-                                                capabilities: NMClient.SecretAgentCapabilities.VPN_HINTS
-                                              });
+        try {
+            this._native = new Shell.NetworkAgent({ identifier: 'org.gnome.Shell.NetworkAgent',
+                                                    capabilities: NMClient.SecretAgentCapabilities.VPN_HINTS
+                                                  });
+        } catch(e) {
+            // Support older versions without NetworkAgent:capabilities
+            this._native = new Shell.NetworkAgent({ identifier: 'org.gnome.Shell.NetworkAgent'
+                                                  });
+        }
 
         this._dialogs = { };
         this._vpnRequests = { };


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