[gnome-characters] characterList: Clear if search returns nothing



commit 38dc88f232d8ba27efa3c7a7f6f8c715c28844f5
Author: Daiki Ueno <dueno src gnome org>
Date:   Thu Feb 12 18:26:38 2015 +0900

    characterList: Clear if search returns nothing
    
    Now that we embed Unicode 7.0.0, we don't need to treat empty search
    results specially.

 src/characterList.js |    3 ---
 src/window.js        |   10 +++++-----
 2 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/src/characterList.js b/src/characterList.js
index 9a623ca..7334103 100644
--- a/src/characterList.js
+++ b/src/characterList.js
@@ -179,9 +179,6 @@ const CharacterListWidget = new Lang.Class({
         this._rows = [];
         this._characters = characters;
 
-        if (characters.length == 0)
-            return;
-
         let start = 0, stop = 1;
         for (; stop <= characters.length; stop++) {
             if (stop % this._cellsPerRow == 0) {
diff --git a/src/window.js b/src/window.js
index 306b656..d682489 100644
--- a/src/window.js
+++ b/src/window.js
@@ -264,11 +264,9 @@ const MainView = new Lang.Class({
 
         let characterList = this._characterListWidgets[name];
         characterList.setCharacters(characters);
-        if (result.length == 0) {
-            if (this._lastPage)
-                this.visible_child_name = this._lastPage;
-            else
-                this.visible_child_name = 'search-banner';
+
+        if (characters.length == 0) {
+            this.visible_child_name = 'search-banner';
         } else {
             this.visible_child_name = name;
         }
@@ -294,6 +292,8 @@ const MainView = new Lang.Class({
     cancelSearch: function() {
         this._cancellable.cancel();
         this._finishSearch('search-result', []);
+        if (this._lastPage)
+            this.visible_child_name = this._lastPage;
     },
 
     setPage: function(name) {


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