Bug 313000 - search filters not being saved
Summary: search filters not being saved
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: search (show other bugs)
Version: Git
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Kåre Särs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-10 08:45 UTC by edA-qa mort-ora-y
Modified: 2013-01-11 03:39 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
adds filters to the combobox as used (664 bytes, patch)
2013-01-10 09:06 UTC, edA-qa mort-ora-y
Details

Note You need to log in before you can comment on or make changes to this bug.
Description edA-qa mort-ora-y 2013-01-10 08:45:27 UTC
The Search and Replace filters are not being saved in a session. Other settings from the search form are being saved.

If I look at the .katesession file it doesn't appear the "Filters" entry is ever modified. If I modify it manually it does load that value, so it appears to be a save issue.  (Though I can't produce multiple filters correctly since the patterns are comma separated, but so must the filters)

Reproducible: Always




I have seen an old bug related to this, but that was resolved some versions ago and this bug is new. I updated my git version and tried again with the same results.
Comment 1 edA-qa mort-ora-y 2013-01-10 08:58:00 UTC
Probably related is that nothing in <plugin_search.cpp> ever appears to add items to the filterCombo object. That is, I don't see any possibility that there would actually be a list of items created, other than by loading them.

Just for a test I add some items just before saving and they are indeed saved, so it'd appear that the loop on line 869 will just never get the user's changes.

What is the intended behaviour? Should the filter be added to the list each time the user searches with a new filter? This wouldn't be hard to add.
Comment 2 edA-qa mort-ora-y 2013-01-10 09:06:17 UTC
Created attachment 76361 [details]
adds filters to the combobox as used
Comment 3 Kåre Särs 2013-01-10 10:51:24 UTC
Thanks.

I noticed this a little while ago but forgot about it.

Hitting "enter" in the filter combo will add it.

/Kåre
Comment 4 edA-qa mort-ora-y 2013-01-10 10:57:00 UTC
No, I don't believe "enter" adds it anymore, as that is directly connected to "startSearch" now.
Comment 5 Kåre Särs 2013-01-10 11:05:01 UTC
I just tested and it _does_ save the new filter. There combo-box is connected 
to the returnPressed() signal of the line-edit.

But this _is_ a bug that has to be fixed ASAP.

/Kåre
Comment 6 Kåre Särs 2013-01-10 23:02:36 UTC
Git commit eceecef2eb736bdee17563f88814cb865bdd2024 by Kåre Särs.
Committed on 10/01/2013 at 23:56.
Pushed by sars into branch 'master'.

Search plugin: Fix updating of comboboxes on search and replace

Thanks for the patch I committed it wit slight changes :)

M  +9    -0    kate/plugins/search/plugin_search.cpp

http://commits.kde.org/kate/eceecef2eb736bdee17563f88814cb865bdd2024
Comment 7 Kåre Särs 2013-01-10 23:08:03 UTC
Git commit ff37da01472d78eb1f60c7af6bc0cf846eef02bf by Kåre Särs.
Committed on 10/01/2013 at 23:56.
Pushed by sars into branch 'KDE/4.10'.

Search plugin: Fix updating of comboboxes on search and replace

Thanks for the patch I committed it wit slight changes :)
(cherry picked from commit eceecef2eb736bdee17563f88814cb865bdd2024)

M  +9    -0    kate/plugins/search/plugin_search.cpp

http://commits.kde.org/kate/ff37da01472d78eb1f60c7af6bc0cf846eef02bf
Comment 8 edA-qa mort-ora-y 2013-01-11 03:39:52 UTC
Looks good, defintiely more useful now. One question though, should perhaps the filter not be a kind of Least-Recently-Used list? That is, should we not perhaps always move the recent item to the top of the list (since only the most recent 10 are saved)?