[gnome-shell] popupMenu: Always use a PopupMenuItem



commit 099c8703ae0620b27bedc263f91900204c67a564
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Apr 19 21:25:28 2013 -0400

    popupMenu: Always use a PopupMenuItem
    
    By this point, we'll know we'll always have a PopupMenuItem.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=698427

 js/ui/popupMenu.js |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index 041434e..b9d6e83 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -1860,7 +1860,9 @@ const RemoteMenu = new Lang.Class({
                                          items: [ ],
                                        };
         let action = this._actions[action_id];
-        let item, target, destroyId, specificSignalId;
+        let target, destroyId, specificSignalId;
+
+        let item = new PopupMenuItem(label);
 
         if (action.state) {
             // Docs have get_state_hint(), except that the DBus protocol
@@ -1869,8 +1871,6 @@ const RemoteMenu = new Lang.Class({
             // always returns null
             // Funny :)
 
-            item = new PopupMenuItem(label);
-
             switch (String.fromCharCode(action.state.classify())) {
             case 'b':
                 action.items.push(item);
@@ -1895,7 +1895,6 @@ const RemoteMenu = new Lang.Class({
             }
         } else {
             target = model.get_item_attribute_value(index, Gio.MENU_ATTRIBUTE_TARGET, null);
-            item = new PopupMenuItem(label);
             action.items.push(item);
             specificSignalId = item.connect('activate', Lang.bind(this, function() {
                 this.actionGroup.activate_action(action_id, target);


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