[gnome-documents/gnome-3-16] mainToolbar: Clean up



commit ccdbb8af05b70d9f0cf9b77c8c9542bcce75817c
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Apr 10 13:39:52 2015 +0200

    mainToolbar: Clean up
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747506

 src/mainToolbar.js |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/mainToolbar.js b/src/mainToolbar.js
index ad7166d..3070ba0 100644
--- a/src/mainToolbar.js
+++ b/src/mainToolbar.js
@@ -125,18 +125,14 @@ const OverviewToolbar = new Lang.Class({
         this._stackSwitcher.show();
 
         // setup listeners to mode changes that affect the toolbar layout
-        this._selectionModeId = Application.selectionController.connect('selection-mode-changed',
+        let selectionModeId = Application.selectionController.connect('selection-mode-changed',
             Lang.bind(this, this._resetToolbarMode));
         this._resetToolbarMode();
 
         this.widget.connect('destroy', Lang.bind(this,
             function() {
                 this._clearStateData();
-
-                if (this._selectionModeId != 0) {
-                    Application.selectionController.disconnect(this._selectionModeId);
-                    this._selectionModeId = 0;
-                }
+                Application.selectionController.disconnect(selectionModeId);
             }));
     },
 


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