[gnome-documents] searchbar: don't use SearchController in the preview searchbar



commit 5c1dfd97564b3a3eec222976ea63d41ba829f364
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Jan 10 20:19:45 2013 -0500

    searchbar: don't use SearchController in the preview searchbar
    
    SearchController is about the overview search, not the preview find
    feature.

 src/searchbar.js |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/src/searchbar.js b/src/searchbar.js
index f22317b..54bd96e 100644
--- a/src/searchbar.js
+++ b/src/searchbar.js
@@ -94,16 +94,8 @@ const Searchbar = new Lang.Class({
             Lang.bind(this, this._onActionStateChanged));
         this._onActionStateChanged(Application.application, 'search', Application.application.get_action_state('search'));
 
-        // connect to search string changes in the controller
-        this._searchEntry.text = Application.searchController.getString();
-        let searchChangedId = Application.searchController.connect('search-string-changed', Lang.bind(this,
-            function(controller, string) {
-                this._searchEntry.text = string;
-            }));
-
         this.widget.connect('destroy', Lang.bind(this,
             function() {
-                Application.searchController.disconnect(searchChangedId);
                 Application.application.disconnect(searchStateId);
                 Application.application.change_action_state('search', GLib.Variant.new('b', false));
             }));
@@ -327,7 +319,18 @@ const OverviewSearchbar = new Lang.Class({
         this._searchEntry = new Gd.TaggedEntry({ width_request: 500 });
         this._searchEntry.connect('tag-clicked',
             Lang.bind(this, this._onTagClicked));
-        this._searchEntry.set_text(Application.searchController.getString());
+
+        // connect to search string changes in the controller
+        this._searchEntry.text = Application.searchController.getString();
+        let searchChangedId = Application.searchController.connect('search-string-changed', Lang.bind(this,
+            function(controller, string) {
+                this._searchEntry.text = string;
+            }));
+
+        this._searchEntry.connect('destroy', Lang.bind(this,
+            function() {
+                Application.searchController.disconnect(searchChangedId);
+            }));
 
         // create the dropdown button
         this._dropdownButton = new Gtk.ToggleButton(



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