[gnome-documents] model: simplify code



commit 83a732d32b8fbc40101672f4798a99da2178c5dd
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Aug 24 15:57:39 2011 -0400

    model: simplify code

 src/trackerModel.js |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)
---
diff --git a/src/trackerModel.js b/src/trackerModel.js
index 2622093..9ec4e92 100644
--- a/src/trackerModel.js
+++ b/src/trackerModel.js
@@ -194,7 +194,7 @@ TrackerModel.prototype = {
     _init: function(connection) {
         this._builder = new QueryBuilder();
         this._factory = new DocFactory.DocFactory();
-        Global.settings.connect('changed::list-view', Lang.bind(this, this._onSettingsChanged));
+        Global.settings.connect('changed::list-view', Lang.bind(this, this._refresh));
 
         this.model = Gd.create_list_store();
         this._connection = connection;
@@ -205,17 +205,13 @@ TrackerModel.prototype = {
 
         this._sourceManager = Global.sourceManager;
         this._sourceManager.connect('active-source-changed',
-                                    Lang.bind(this, this._refreshAccountFilter));
+                                    Lang.bind(this, this._refresh));
 
         this._offsetController = Global.offsetController;
         this._offsetController.connect('offset-changed',
                                        Lang.bind(this, this._performCurrentQuery));
     },
 
-    _onSettingsChanged: function() {
-        this._refresh();
-    },
-
     _refreshMinerNow: function() {
         this._miner.RefreshDBRemote(DBus.CALL_FLAG_START, Lang.bind(this,
             function(res, error) {
@@ -309,17 +305,13 @@ TrackerModel.prototype = {
 
     populateForOverview: function(filter) {
         this._filter = filter;
-        this._refreshAccountFilter(this._sourceManager.getActiveSourceId());
+        this._refresh();
     },
 
     setFilter: function(filter) {
         this._filter = filter;
         this._offsetController.resetOffset();
         this._refresh();
-    },
-
-    _refreshAccountFilter: function() {
-        this._refresh();
     }
 };
 Signals.addSignalMethods(TrackerModel.prototype);



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