Mapping of installed files

Andreas Pakulat apaku at gmx.de
Thu Jun 26 19:03:19 UTC 2008


On 26.06.08 20:10:35, David Nolden wrote:
> Am Donnerstag, 26. Juni 2008 19:48:36 schrieb Andreas Pakulat:
> > ProjectItem* getSourceForInstalledFile( const KUrl& url )
> >
> > Note that the latter might be a lot slower than the former (or more
> > memory-extensive due to storing a reverse map of installed files to
> > source files).
> 
> Yes but this would be the right solution. It would cost nearly no additional 
> memory if we'd use a map IndexedString -> IndexedString, because the 
> file-names will be indexed anyway by the du-chain(so its just integers 
> mapping to integers).
> 
> Thinking of it, maybe the simplest solution would be just adding 
> an "addMap(IndexedString installed, IndexedString source)" function to 
> DUChain, and the build-system could call that function while parsing the 
> project files.

That sounds like the right idea, but I suggest to use
addInstallationMapping or something else more verbose. Simply because
you actually want a map that covers all projects at once instead of
having to iterate the projects and buildmanagers each time you want to
do a lookup.

Hmm, we need to document that in the API very cleanly as I don't see a
way to enforce that.

Andreas

-- 
Never give an inch!




More information about the KDevelop-devel mailing list