Add button to re-run search in files, so a user doesn't need to search again through the dialog.
Details
Works fine, just as expected. All the tests were passed.
Diff Detail
- Repository
- R33 KDevPlatform
- Lint
Lint Skipped - Unit
Unit Tests Skipped
I think we need a more sophisticated approach. I suggest creating a new struct GrepJobSettings which holds all settings you can specify in a search dialog. Then, remove all the individual setters/getters (e.g. GrepDialog::patternString, GrepJob::setPatternString) in both GrepDialog/GrepJob and instead just use GrepJobSettings in both places.
To store the last used settings one could add another field to GrepPlugin, e.g. m_lastGrepJobSettings;. Makes sense?
plugins/grepview/grepoutputview.cpp | ||
---|---|---|
283 | This will use the pattern from the current selection instead of the last search pattern. This is not what we want unfortunately. |
Moved most of GrepDialog's and GrepJob's set/getters away, replacing them with a nicer setSettings()
Some nitpicks. :)
plugins/grepview/grepdialog.cpp | ||
---|---|---|
442 | Unneeded indentation change. | |
plugins/grepview/grepdialog.h | ||
36 | Probably it's better to use "const GrepJobSettings& settings" like in GrepJob. | |
plugins/grepview/grepjob.h | ||
47 | Maybe some more readable name? Something like "template" or maybe "searchTemplate". | |
68 | What's point of using comments here? It's not necessary since old version still be available on git in case it'll be needed. | |
121 | Same there. Indentation issue. | |
123 | Is m_templateString used somewhere now? If no, please remove it. |
Fixed all the issues by @ematirov and a bug caused by previous revisions of the diff. The bug was all about providing up-to-date data to GrepJob in GrepDialog::startSearch()
Hm... Did you test it?
It doesn't work for me:
- Open a project.
- Search in files
- 2 matches found.
- Click "refresh"
- no matches and search string is empty.