[gnome-documents/wip/cosimoc/view-rework: 3/20] Connect to settings signals for view-as state changes



commit 5f751f01ac1f40e78bf96b10ec58f2c79593ce0e
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Sun Jul 31 21:15:35 2016 -0700

    Connect to settings signals for view-as state changes
    
    Instead of action signals. This allows us to decouple the action state
    from the views, which will be useful for a later cleanup.

 src/documents.js   |    6 +++---
 src/mainToolbar.js |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/documents.js b/src/documents.js
index 608891e..60fa918 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -262,8 +262,8 @@ const DocCommon = new Lang.Class({
         this.populateFromCursor(cursor);
 
         this._refreshIconId =
-            Application.application.connect('action-state-changed::view-as',
-                                            Lang.bind(this, this.refreshIcon));
+            Application.settings.connect('changed::view-as',
+                                         Lang.bind(this, this.refreshIcon));
         this._filterId =
             Application.searchCategoryManager.connect('active-changed',
                                                       Lang.bind(this, this.refreshIcon));
@@ -598,7 +598,7 @@ const DocCommon = new Lang.Class({
             this._collectionIconWatcher = null;
         }
 
-        Application.application.disconnect(this._refreshIconId);
+        Application.settings.disconnect(this._refreshIconId);
         Application.searchCategoryManager.disconnect(this._filterId);
     },
 
diff --git a/src/mainToolbar.js b/src/mainToolbar.js
index e80ee8b..14772c3 100644
--- a/src/mainToolbar.js
+++ b/src/mainToolbar.js
@@ -185,7 +185,7 @@ const OverviewToolbar = new Lang.Class({
                                                     popover: viewMenu });
         this.toolbar.pack_end(this._viewMenuButton);
 
-        this._viewSettingsId = Application.application.connect('action-state-changed::view-as',
+        this._viewSettingsId = Application.settings.connect('changed::view-as',
             Lang.bind(this, this._updateViewMenuButton));
         this._updateViewMenuButton();
     },
@@ -332,7 +332,7 @@ const OverviewToolbar = new Lang.Class({
         }
 
         if (this._viewSettingsId != 0) {
-            Application.application.disconnect(this._viewSettingsId);
+            Application.settings.disconnect(this._viewSettingsId);
             this._viewSettingsId = 0;
         }
     },


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