[gnome-documents] view: simplify code



commit 94c2770e8d9299aad6aad3b0a561fe5319941793
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Mar 12 18:23:40 2012 -0400

    view: simplify code

 src/view.js |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/src/view.js b/src/view.js
index 3f3fcae..3756783 100644
--- a/src/view.js
+++ b/src/view.js
@@ -122,8 +122,6 @@ View.prototype = {
                             Lang.bind(this, this._onSelectionModeRequest));
         this.widget.connect('view-selection-changed',
                             Lang.bind(this, this._onViewSelectionChanged));
-        this.widget.connect('notify::view-type',
-                            Lang.bind(this, this._onViewTypeChanged));
 
         // connect to settings change for list/grid view
         this._viewSettingsId =
@@ -149,6 +147,9 @@ View.prototype = {
     _updateTypeForSettings: function() {
         let viewType = Global.settings.get_enum('view-as');
         this.widget.set_view_type(viewType);
+
+        if (viewType == Gd.MainViewType.LIST)
+            this._addListRenderers();
     },
 
     _addListRenderers: function() {
@@ -222,11 +223,6 @@ View.prototype = {
             }));
     },
 
-    _onViewTypeChanged: function() {
-        if (this.widget.get_view_type() == Gd.MainViewType.LIST)
-            this._addListRenderers();
-    },
-
     _onSelectionModeRequest: function() {
         Global.selectionController.setSelectionMode(true);
     },



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