[gnome-documents] tracker-controller: simplify code a bit



commit 869d51e8e8c55f80e5d47d8a77aebaf20b81dc9b
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Jun 1 16:38:48 2012 -0400

    tracker-controller: simplify code a bit

 src/trackerController.js |   35 +++++++++++++----------------------
 1 files changed, 13 insertions(+), 22 deletions(-)
---
diff --git a/src/trackerController.js b/src/trackerController.js
index 901dd0e..4dacb75 100644
--- a/src/trackerController.js
+++ b/src/trackerController.js
@@ -120,27 +120,18 @@ const TrackerController = new Lang.Class({
         // useful for debugging
         this._lastQueryTime = 0;
 
-        this._sourceManager = Global.sourceManager;
-        this._sourceManager.connect('item-added', Lang.bind(this, this._onSourceAddedRemoved));
-        this._sourceManager.connect('item-removed', Lang.bind(this, this._onSourceAddedRemoved));
-        this._sourceManager.connect('active-changed',
-                                    Lang.bind(this, this._refreshForObject));
-
-        this._offsetController = Global.offsetController;
-        this._offsetController.connect('offset-changed',
-                                       Lang.bind(this, this._performCurrentQuery));
-
-        Global.collectionManager.connect('active-changed',
-                                         Lang.bind(this, this._refreshForObject));
-        Global.searchController.connect('search-string-changed',
-                                        Lang.bind(this, this._refreshForObject));
-        Global.searchCategoryManager.connect('active-changed',
-                                             Lang.bind(this, this._refreshForObject));
-        Global.searchTypeManager.connect('active-changed',
-                                         Lang.bind(this, this._refreshForObject));
-
-        Global.searchMatchManager.connect('active-changed',
-                                          Lang.bind(this, this._onSearchMatchChanged));
+        Global.sourceManager.connect('item-added', Lang.bind(this, this._onSourceAddedRemoved));
+        Global.sourceManager.connect('item-removed', Lang.bind(this, this._onSourceAddedRemoved));
+        Global.sourceManager.connect('active-changed', Lang.bind(this, this._refreshForObject));
+
+        Global.offsetController.connect('offset-changed', Lang.bind(this, this._performCurrentQuery));
+
+        Global.collectionManager.connect('active-changed', Lang.bind(this, this._refreshForObject));
+        Global.searchController.connect('search-string-changed', Lang.bind(this, this._refreshForObject));
+        Global.searchCategoryManager.connect('active-changed', Lang.bind(this, this._refreshForObject));
+        Global.searchTypeManager.connect('active-changed', Lang.bind(this, this._refreshForObject));
+
+        Global.searchMatchManager.connect('active-changed', Lang.bind(this, this._onSearchMatchChanged));
     },
 
     _setQueryStatus: function(status) {
@@ -169,7 +160,7 @@ const TrackerController = new Lang.Class({
         if (exception)
             Global.errorHandler.addQueryError(exception);
         else
-            this._offsetController.resetItemCount();
+            Global.offsetController.resetItemCount();
 
         if (this._queryQueued) {
             this._queryQueued = false;



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