Removing doubled search results from the grepview plugin

Milian Wolff mail at milianw.de
Fri Jul 9 19:34:01 UTC 2010


George Syron, 09.07.2010:
> It seems that some project files are added multiple times to the project's
> file item list, so that the grep command sometimes shows the same result
> multiple times. I've added a simple QSet to the grepjob method, so that the
> file list written to the tmp file becomes unique. I haven't found any
> performance issues with that, tested on kdevplatform and kdevelop source
> trees.
> 
> Btw, this seems like it is a deeper problem, because project->files() is
> not a unique list, and I think that also causes the "Show uses" feature to
> show some results more than once.
> 
> Patch for grepview plugin is attached.

Actually the grepjop code is simply "wrong". It uses project->files() which 
returns all FileItems in the project. This is not guaranteed to be unique as 
Andreas said, e.g. because you have two FileItems for .cpp files in targets.

Instead the code should use project->fileSet() which is guaranteed to have each 
url only once.

If you want, please write a patch for that.

Bye
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20100709/bd828850/attachment.sig>


More information about the KDevelop-devel mailing list