[gnome-documents/gnome-3-16] Don't stomp on the search criteria when going back from a collection



commit d3725da4fccee829c67cb878d6be62f4e523ee1b
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Mar 17 20:36:41 2015 +0100

    Don't stomp on the search criteria when going back from a collection
    
    There are two things going on here:
      - We want to restore the search criteria when going back to the
        search results from a collection
      - We want to relax the search criteria when viewing a collection
        from the search results
    
    There is no need to do the later when there is no active collection.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746367

 src/searchbar.js |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/searchbar.js b/src/searchbar.js
index 9644071..9fcc808 100644
--- a/src/searchbar.js
+++ b/src/searchbar.js
@@ -240,7 +240,10 @@ const OverviewSearchbar = new Lang.Class({
         this._searchEntry.set_text(string);
     },
 
-    _onActiveCollectionChanged: function() {
+    _onActiveCollectionChanged: function(manager, collection) {
+        if (!collection)
+            return;
+
         let searchType = Application.searchTypeManager.getActiveItem();
 
         if (Application.searchController.getString() != '' ||


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