[VCS] diff on dirs?

Matt Rogers mattr at kde.org
Tue Oct 9 02:07:59 UTC 2007


On Monday 08 October 2007 08:06:27 pm Andreas Pakulat wrote:
> On 08.10.07 17:07:24, Matthew Woehlke wrote:
> > Andreas Pakulat wrote:
> > > [snip preamble about recursive diff]
> > > The diff is able to carry recursive information, but we don't have a
> > > way to produce enough information for "left" and "right" side of the
> > > diff.
> > >
> > > On a quick thought: QMap<QVariant,QString> for those, mapping file
> > > locations (either local or remote) into content strings might be
> > > enough. (and QByteArray versions for the binary)
> >
> > That sounds about right.
>
> Unfortunately its not as easy as that :( QVariant provides no qHash and
> no operator< so you can't use it as a key in a QMap or QHash.
>
> The problem we have is that we use KUrl for client-side-files and
> QString for server-side-locations. So QVariant seemed reasonable to have
> only 1 method that can take either of the two.
>
> Possible solutions:
>
> a) Always use QString, this is a breakup with other parts of the
> platform API which use KUrl
> b) A new Location type that has operator < or a qHash function and
> allows to retrieve either a string or a url and also knows how it was
> constructed (i.e. wether it is a repo or local location)
> c) Only use QString in VcsDiff and store the information wether thats
> repo location or local locations in the VcsDiff object as well
>
> Personally I'd prefer b) I think, with changing all QVariant's to
> Location in the API's but leaving KUrl/QString API's as they are now.
>
> Oh and of course the name of the Location type is subject to discussion
> as well, if somebody has a better idea...
>
> Andreas

I vote for b. 

No idea for a better name though
-- 
Matt




More information about the KDevelop-devel mailing list