[polari] connection: Only refilter networks on actual filter changes



commit c8814c830474c5ddfd3671d77c12548a35eb7661
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun Mar 12 02:34:02 2017 +0100

    connection: Only refilter networks on actual filter changes
    
    Use the shared updateTerms() helper and take advantage of its return
    value.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=779960

 src/connections.js |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/connections.js b/src/connections.js
index 871807a..689e596 100644
--- a/src/connections.js
+++ b/src/connections.js
@@ -7,6 +7,7 @@ const Tp = imports.gi.TelepathyGLib;
 
 const AccountsMonitor = imports.accountsMonitor;
 const NetworksManager = imports.networksManager;
+const Utils = imports.utils;
 
 const DEFAULT_PORT = 6667;
 const DEFAULT_SSL_PORT = 6697;
@@ -107,8 +108,8 @@ const ConnectionsList = new Lang.Class({
     },
 
     setFilter: function(filter) {
-        this._filterTerms = filter.trim().toLowerCase().replace(/\s+/g, ' ').split(' ');
-        this._list.invalidate_filter();
+        if (Utils.updateTerms(this._filterTerms, filter))
+            this._list.invalidate_filter();
     },
 
     activateFirst: function() {


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