Removing doubled search results from the grepview plugin

Milian Wolff mail at
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.

Milian Wolff
mail at
-------------- 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: <>

More information about the KDevelop-devel mailing list