[gnome-photos/wip/rishi/collection: 3/10] embed, overview-searchbar: Simplify code
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/collection: 3/10] embed, overview-searchbar: Simplify code
- Date: Fri, 25 Aug 2017 22:26:07 +0000 (UTC)
commit ca5b9a05ffcf52de8f2d99d474981a5c78fc0403
Author: Debarshi Ray <debarshir gnome org>
Date: Fri Aug 18 14:53:32 2017 +0200
embed, overview-searchbar: Simplify code
OverviewSearchbar unsets all the search criteria, except the search
string, when it gets hidden. There is no reason for it not to.
src/photos-embed.c | 14 ++------------
src/photos-overview-searchbar.c | 2 ++
2 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/src/photos-embed.c b/src/photos-embed.c
index 1bff91c..30edeff 100644
--- a/src/photos-embed.c
+++ b/src/photos-embed.c
@@ -345,19 +345,9 @@ photos_embed_active_collection_changed (PhotosBaseManager *manager, PhotosBaseIt
return;
if (collection == NULL)
- {
- photos_embed_restore_search (self);
- }
+ photos_embed_restore_search (self);
else
- {
- const gchar *str;
-
- photos_embed_save_search (self);
-
- str = photos_search_controller_get_string (self->srch_cntrlr);
- if (g_strcmp0 (str, "") != 0)
- photos_search_controller_set_string (self->srch_cntrlr, "");
- }
+ photos_embed_save_search (self);
}
diff --git a/src/photos-overview-searchbar.c b/src/photos-overview-searchbar.c
index ad2815a..6480d56 100644
--- a/src/photos-overview-searchbar.c
+++ b/src/photos-overview-searchbar.c
@@ -102,6 +102,8 @@ photos_overview_searchbar_hide (PhotosSearchbar *searchbar)
photos_base_manager_set_active_object_by_id (self->srch_mtch_mngr, "all");
photos_base_manager_set_active_object_by_id (self->src_mngr, "all");
+ photos_search_controller_set_string (self->srch_cntrlr, "");
+
PHOTOS_SEARCHBAR_CLASS (photos_overview_searchbar_parent_class)->hide (searchbar);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]