[patch] remove IProjectController::findProjectByName

Andreas Pakulat apaku at gmx.de
Thu Nov 13 11:14:33 UTC 2008


On 13.11.08 10:44:45, Manuel Breugelmans wrote:
> This findProjectByName method is flawed because it is perfectly legal to have 
> multiple projects with the same name.

Actually until now the plan was to have the project name as identifier :)

> Right now it retrieves the first project 
> with this name in it's internal data structure, ie undefined behavior.
> 
> The method is only used in the buildsetmodel. I didn't actually check but I'm 
> pretty sure the buildset will act weird with multiple identically named 
> projects.
> 
> Attached patch removes this method from the API. It also fixes the buildset by 
> storing the project root URL for every item.

But I agree the url might be a bit more "natural" for identifying a
project.

However you can easily fix the method instead of removing it: Return a list
of IProject instead. Then its clear that there might be multiple projects
with that name. Of course we can always add it back later when its actually
needed, if the buildset really is the only user right now.

Andreas

-- 
You will not be elected to public office this year.




More information about the KDevelop-devel mailing list