Implement persisting search history for Find in Files
ClosedPublic

Authored by croick on Jun 18 2017, 10:20 PM.

Details

Summary

Major Changes:

  • grep job settings are saved in the GrepDialog config sections
  • when starting a session, grep jobs with the recalled settings are started

Minor Changes:

  • refresh button now restarts grep job for currently selected result
  • fix clearing of old entries beyond display limit in result view
  • disable refresh and clear buttons for empty result history
  • do not set up UI of GrepDialog when it stays hidden
  • keep track of all GrepDialogs for plugin unloading (fix)
  • fix saving of not yet inserted combo box entries

Remark:
To make sure all projects are loaded after startup (for searches
in project files only), the number of loaded projects must match
the number of projects to be loaded from the "General Options"
config section.

BUG: 380864
BUG: 381754

Test Plan
  • start a session with several projects to be opened
  • use the "Find/Replace in Files" tool to search in files
  • restart the same session and observe how the old searches are done after all projects have been loaded
  • use the refresh button to redo a selected search

Diff Detail

Repository
R33 KDevPlatform
Branch
grephistory
Lint
No Linters Available
Unit
No Unit Test Coverage
croick created this revision.Jun 18 2017, 10:20 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptJun 18 2017, 10:20 PM
apol added a subscriber: apol.Jun 18 2017, 10:24 PM
apol added inline comments.
plugins/grepview/grepviewplugin.cpp
109–113

const &

183

Please remove style changes, they make it much harder to review your patches.

croick updated this revision to Diff 15559.Jun 18 2017, 10:53 PM
  • revert style changes, use const & in foreach
croick updated this revision to Diff 15560.Jun 18 2017, 11:06 PM

revert one missed out style change

croick marked 2 inline comments as done.Jun 18 2017, 11:12 PM
croick added inline comments.
plugins/grepview/grepdialog.cpp
113–149

I made these static from the former directoryChanged and getDirectoryChoice member functions

415

I wonder if there is a better way to get the number of staged projects.

croick updated this revision to Diff 16091.Jul 1 2017, 7:45 PM
croick edited the summary of this revision. (Show Details)
  • fix saving of not yet inserted combo box entries, BUG 381754
apol accepted this revision.Jul 2 2017, 11:15 PM

LGTM, haven't tested though.

This revision is now accepted and ready to land.Jul 2 2017, 11:15 PM
croick added a comment.Jul 5 2017, 6:34 AM

Thanks for the review. In two weeks I'm using this I did not observe any unexpected behaviour, so I'll commit now.

This revision was automatically updated to reflect the committed changes.