[KDev4] let's clearify VCS interfaces

dukju ahn dukjuahn at gmail.com
Sun Apr 1 09:20:16 UTC 2007


Hi,

Current VCS interface is good but IMHO needs some modifications.

1. Use QMap instead of QList for VcsFileInfo

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

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.

3. Don't return reference which is Out-Of-Bound.

In summary rather than,,
virtual const QList<VcsFileInfo>&
statusSync(const KUrl &dirPath, WorkingMode mode ) = 0;

I propose
virtual bool statusSync( QMap<KUrl, VcsFileInfo> &, //output
                                KUrl &dirPath,                     //input
                                WorkingMode mode ) = 0;   // input




More information about the KDevelop-devel mailing list