[KDev4] let's clearify VCS interfaces

Matt Rogers mattr at kde.org
Mon Apr 2 16:19:25 UTC 2007


On Sunday 01 April 2007 04:57, Andreas Pakulat wrote:
> 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
>
> > 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.
> Also this method is not meant to find the status for a specific file, as
> far as I can see. It seems to be for getting the status of a whole dir
> and all files in there to reduce the amount of function calls when
> retrieving the initial status for a project tree.
>
> > 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.
>
> > 3. Don't return reference which is Out-Of-Bound.
>
> What do you mean, out-of-bounds?
>

Returning references to local variables declared on the stack means you return 
a variable that goes out of scope and could possibly be invalid.
-- 
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/4ea274f5/attachment.sig>


More information about the KDevelop-devel mailing list