[gnome-photos] Don't stomp on the search criteria when going back from a collection



commit 03697b4fc1f2c752f829e76b790da8879ee9af78
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Mar 16 17:28:35 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.
    
    Earlier, this only worked by chance. OverviewSearchbar's
    CollectionManager::active-changed handler ran before Embed's handler,
    which prevented the restored search criteria from being unset. The
    order changed after the CollectionManager was merged with the
    ItemManager and caused this regression.
    
    Fall out from 34edc98b448c122d07ead5f7d2af098b59fc0890

 src/photos-overview-searchbar.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-overview-searchbar.c b/src/photos-overview-searchbar.c
index 1a2ccb6..82db04f 100644
--- a/src/photos-overview-searchbar.c
+++ b/src/photos-overview-searchbar.c
@@ -1,6 +1,6 @@
 /*
  * Photos - access, organize and share your photos on GNOME
- * Copyright © 2014 Red Hat, Inc.
+ * Copyright © 2014, 2015 Red Hat, Inc.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -28,6 +28,7 @@
 #include <gio/gio.h>
 #include <libgd/gd.h>
 
+#include "photos-base-item.h"
 #include "photos-base-manager.h"
 #include "photos-dropdown.h"
 #include "photos-filterable.h"
@@ -91,13 +92,16 @@ photos_overview_searchbar_active_changed (PhotosOverviewSearchbar *self,
 
 
 static void
-photos_overview_searchbar_collection_active_changed (PhotosOverviewSearchbar *self)
+photos_overview_searchbar_collection_active_changed (PhotosOverviewSearchbar *self, PhotosBaseItem 
*collection)
 {
   PhotosOverviewSearchbarPrivate *priv = self->priv;
   PhotosSearchType *search_type;
   const gchar *id;
   const gchar *str;
 
+  if (collection == NULL)
+    return;
+
   search_type = PHOTOS_SEARCH_TYPE (photos_base_manager_get_active_object (priv->srch_typ_mngr));
   str = photos_search_controller_get_string (priv->srch_cntrlr);
   id = photos_filterable_get_id (PHOTOS_FILTERABLE (search_type));


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