VcsRevision usage question.
dukju ahn
dukjuahn at gmail.com
Wed Jun 20 18:35:16 UTC 2007
2007/6/6, Andreas Pakulat <apaku at gmx.de>:
> On 06.06.07 09:27:08, Matthew Woehlke wrote:
> > dukju ahn wrote:
> > > 2007/6/5, Matthew Woehlke <mw_triad at users.sourceforge.net>:
> > >> dukju ahn wrote:
> > >>> Lastly, when revision is RevisionType::Special, what is the format of
> > >>> QString revisionValue()? Is it just int? or string such as "Head"?
> > >> It would be e.g. "HEAD", possibly all upper case like that. Again we
> > >> should standardize this.
> > >
> > > Oh no. If RevisionType is Special, QString revisionValue() should return
> > > the RevisionSpecialType enum value, which would be int.
> > > I was silly to ask such an easy question. It was very late night yesterday :)
> >
> > Huh? Why would you do that?
> >
> > I think we need to ask what the point of revisionValue is; my assumption
> > would be that it is to return a human-readable string (Andreas: an
> > argument /against/ returning QVariant here), in which case Head must be
> > translated as "HEAD" (or "Head", "head", etc, but certainly not "1"!).
>
> Hmm, right, the API can cope with the revision directly... So I agree to
> stay with QString and I think we should use all upper-case, as thats
> what seems to be common around VCS documentation for these things.
We already defined RevisionSpecialType as an enum. Then why should we
return these enum values like QString("HEAD") ??
IF( RevisionType revision.revisionType() == RevisionType::Special )
{
RevisionSpecialType special = revision.revisionSpecialType()
switch( special )
case VcsRevision::Head:
}
So we need to add VcsRevisionSpecialType revisionSpecialType(), then
Above concept is more natural once we defined RevisionSpecialType enum.
More information about the KDevelop-devel
mailing list