[gnome-documents] Simplify search entry timeout



commit b6bdbbb7c2add98954cfecb325f5202654106624
Author: Bastien Nocera <hadess hadess net>
Date:   Fri May 17 15:58:50 2013 +0200

    Simplify search entry timeout
    
    GtkSearchEntry now uses a 150 msecs timeout (the same as in gnome-shell)
    which means that we don't need to rate-limit ourselves.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700525

 src/searchbar.js |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)
---
diff --git a/src/searchbar.js b/src/searchbar.js
index 6417e37..4e9a6b5 100644
--- a/src/searchbar.js
+++ b/src/searchbar.js
@@ -35,13 +35,10 @@ const Manager = imports.manager;
 const Tweener = imports.tweener.tweener;
 const Utils = imports.utils;
 
-const _SEARCH_ENTRY_TIMEOUT = 200;
-
 const Searchbar = new Lang.Class({
     Name: 'Searchbar',
 
     _init: function() {
-        this._searchEntryTimeout = 0;
         this._searchTypeId = 0;
         this._searchMatchId = 0;
         this.searchChangeBlocked = false;
@@ -77,19 +74,10 @@ const Searchbar = new Lang.Class({
 
         this._searchEntry.connect('changed', Lang.bind(this,
             function() {
-                if (this._searchEntryTimeout != 0) {
-                    Mainloop.source_remove(this._searchEntryTimeout);
-                    this._searchEntryTimeout = 0;
-                }
-
                 if (this.searchChangeBlocked)
                     return;
 
-                this._searchEntryTimeout = Mainloop.timeout_add(_SEARCH_ENTRY_TIMEOUT, Lang.bind(this,
-                    function() {
-                        this._searchEntryTimeout = 0;
-                        this.entryChanged();
-                    }));
+                this.entryChanged();
             }));
 
         // connect to the search action state for visibility


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