After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 762621 - Saved logs aren't filtered when searching
Saved logs aren't filtered when searching
Status: RESOLVED FIXED
Product: gnome-logs
Classification: Other
Component: general
3.19.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-logs maintainer(s)
gnome-logs maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-02-24 15:43 UTC by Allan Day
Modified: 2016-02-25 10:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Only output search result (1.10 KB, patch)
2016-02-25 07:50 UTC, Jonathan Kang
needs-work Details | Review
output-search-result.patch (1.34 KB, patch)
2016-02-25 10:15 UTC, Jonathan Kang
committed Details | Review

Description Allan Day 2016-02-24 15:43:01 UTC
When you save logs, whatever is currently in the logs view is saved, so that changing the filters on the left or the boot at the top is reflected in the save action.

However, this logic doesn't hold true when searching: if you search and then save, it's not just the search results that are saved.

Two possible fixes:

 1. Make the save button insensitive while a search is active
 2. Make save only save search results

I'm not sure how often people will want to save search results. If it's not that often, then 1 might be fine.

Alternatively, you could do 1 until 2 is fixed.
Comment 1 Jonathan Kang 2016-02-25 07:50:55 UTC
Created attachment 322333 [details] [review]
Only output search result

I implemented the second solution.

We only output the search results shown in the list view.
Comment 2 David King 2016-02-25 09:28:19 UTC
Review of attachment 322333 [details] [review]:

::: src/gl-eventviewlist.c
@@ +96,3 @@
                                              index);
 
+        if (gtk_widget_get_mapped (GTK_WIDGET (row)) == FALSE)

This needs a comment as to why the check is there. Is using "mapped" good enough, or would "visible" work?
Comment 3 Jonathan Kang 2016-02-25 09:32:32 UTC
(In reply to David King from comment #2)
> Review of attachment 322333 [details] [review] [review]:
> 
> ::: src/gl-eventviewlist.c
> @@ +96,3 @@
>                                               index);
>  
> +        if (gtk_widget_get_mapped (GTK_WIDGET (row)) == FALSE)
> 
> This needs a comment as to why the check is there. Is using "mapped" good
> enough, or would "visible" work?

Fine. I'll add some comments here.

Using "visible" won't work. Because as for rows that's not shown while searching, their "visible" property is still TRUE. While "child visible" is FALSE. See links below:
https://github.com/GNOME/gtk/blob/master/gtk/gtklistbox.c#L2189
https://github.com/GNOME/gtk/blob/master/gtk/gtklistbox.c#L2212
Comment 4 Jonathan Kang 2016-02-25 10:15:19 UTC
Created attachment 322346 [details] [review]
output-search-result.patch

Add comment and update the if condition
Comment 5 David King 2016-02-25 10:25:39 UTC
Review of attachment 322346 [details] [review]:

Sure, go ahead.
Comment 6 Jonathan Kang 2016-02-25 10:28:06 UTC
Comment on attachment 322346 [details] [review]
output-search-result.patch

Pushed to master as commit 2fc19e0f0436788bdf9e81288bcafd8c91f6d039