[gnome-shell] bluetooth: Fix undefined variable issue



commit d856338f863f9c8ccb6a691a657955a2940f0891
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Nov 11 20:04:10 2011 -0500

    bluetooth: Fix undefined variable issue
    
    https://bugzilla.gnome.org/show_bug.cgi?id=663891

 js/ui/status/bluetooth.js |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/status/bluetooth.js b/js/ui/status/bluetooth.js
index f2d95f5..9118c6f 100644
--- a/js/ui/status/bluetooth.js
+++ b/js/ui/status/bluetooth.js
@@ -204,9 +204,10 @@ Indicator.prototype = {
 
     _buildDeviceSubMenu: function(item, device) {
         if (device.can_connect) {
+            let menuitem = new PopupMenu.PopupSwitchMenuItem(_("Connection"), device.connected);
             item._connected = device.connected;
-            item._connectedMenuitem = new PopupMenu.PopupSwitchMenuItem(_("Connection"), device.connected);
-            item._connectedMenuitem.connect('toggled', Lang.bind(this, function() {
+            item._connectedMenuItem = menuitem;
+            menuitem.connect('toggled', Lang.bind(this, function() {
                 if (item._connected > ConnectionState.CONNECTED) {
                     // operation already in progress, revert
                     // (should not happen anyway)
@@ -241,7 +242,7 @@ Indicator.prototype = {
                 }
             }));
 
-            item.menu.addMenuItem(item._connectedMenuitem);
+            item.menu.addMenuItem(menuitem);
         }
 
         if (device.capabilities & GnomeBluetoothApplet.Capabilities.OBEX_PUSH) {



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