[KDev4] let's clearify VCS interfaces

Matt Rogers mattr at kde.org
Mon Apr 2 16:20:49 UTC 2007


On Sunday 01 April 2007 06:15, dukju ahn wrote:
> 2007/4/1, Andreas Pakulat <apaku at gmx.de>:
> > On 01.04.07 02:20:16, dukju ahn wrote:
> > > Current VCS interface is good but IMHO needs some modifications.
> > >
> > > 1. Use QMap instead of QList for VcsFileInfo
> >
> > Why? The VcsFileInfo class already contains the url
>
> Yes, but it QMap is more efficient to get the specific items.
> If we have only QList, we should iterate all over the list.
>
> > > Currently statusSync() and statusASync() both return QList<VcsFileInfo>
> > > But what is the purpose of these methods? It is to retrieve any
> > > file/dir's status easily. If we only have QList, we should iterate all
> > > the way to retrieve some specific file/dir's status
> >
> > Well, I'd like to see if we can remove that class completely, because it
> > makes our interface not an abstract interface anymore, but a real class.
>
> Do you mean VcsFileInfo? Rather than removing, we can make getters/setters
> pure virtual. Without this class, how can we represent the file/dir status?
>
> But one special case is static state2string(). I think we will
> need coherent string that describes the status.
> So, Is it possible to have a vertual class with inline static method?
>

Status is SCM dependant and should probably not be in the API, IMHO.

> > > 2. Allow statusSync() and statusASync() to be called on file.
> > >
> > > Currently, the argument to these method is KUrl &dirPath.
> > > To retrieve the status of one file, one should find file's parent path
> > > But it would be efficient if the caller can specify filename directly.
> >
> > But then 1. is totally bogus, because if you want to know the status of
> > a specific file you can use this overload.
>
> OK. I agree that.
>
> > > 3. Don't return reference which is Out-Of-Bound.
> >
> > What do you mean, out-of-bounds?
>
> QMap& KSomeClass::getMap()
> {
>       QMap map;
>       map.insert(xxxx);
>       return map;
> }
> This is what I meant. The returned reference is invalid because it
> is destroyed after the function returns.
>
> Below is correct.
> void KSomeClass::getMap( QMap &map )
> {
>     map.insert(xxx);
> }
>
> _______________________________________________
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel

-- 
Matt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20070402/a9704201/attachment.sig>


More information about the KDevelop-devel mailing list