Andreas Pakulat apaku at
Sat Feb 9 14:56:51 UTC 2008

On 09.02.08 14:46:12, David Nolden wrote:
> On Saturday 09 February 2008 13:40:42 Andreas Pakulat wrote:
> > On 09.02.08 12:51:39, David Nolden wrote:
> > > I have always used prettyUrl while converting to HashedString, because I
> > > think it also does some normalization.
> >
> > The problem with prettyUrl is that
> >
> > KUrl u;
> > u != KUrl(u.prettyUrl())
> >
> > at least not in the general case. In particular passwords are stripped,
> > and possibly other things.
> Yep, but the idea is that the du-chain is stored to the disk some time, so 
> removing sensible stuff like passwords before putting the url into the 
> du-chain would be a good idea, so the whole du-chain works with the same kind 
> of urls, and comparing the url of files loaded from the duchain cache with 
> actual urls would not cause any headaches once we have the caching.

Hmm, I guess stripping the password is not a big deal. The url info
used for DUChain is never ever used to actually get the file that it
points to right? Because the other thing that prettyUrl() does is
removing various escapes, which means it might be a problem when trying
to use that URL to actually get at the file later on. If this is simply
about some almost-unique identification of the file then I guess
prettyUrl() is good enough.

> > > What about adding a constructor IdentifiedFIle(const KUrl&, int id = 0)
> > > that would do the conversion, then you could save a lot of typing.
> >
> > I really don't know. Is it a problem if one reads the code and doesn't
> > see its an identified file (because its created implicitly)?
> An IdentifiedFile is nothing more than a file-name connected with an integer, 
> so this is really a mini-conversion. Personally I hate code 
> like "IdentifiedFile(HashedString(m_url.path()));" and similar things with 
> AbstractType::Ptr that kdevelop is full of. I'd prefer solving the thing in 
> one single place, instead of blowing up the whole code-base with such stuff. 
> After all it's also a kind of code-duplication.



You will forget that you ever knew me.

More information about the KDevelop-devel mailing list