REMINDER: Final review of VCS interfaces

Andreas Pakulat apaku at gmx.de
Fri Jun 1 19:57:52 UTC 2007


On 01.06.07 20:56:57, Robert Gruber wrote:
> On Fri, 1 Jun 2007 18:38:42 Andreas Pakulat wrote:
> > > Deriving CvsJob from both our VcsJob interface-class and KJob isn't
> > possible. 
> > > 
> > > You cannot inherit from two QObject subclasses:
> > > [ 35%] Generating cvsjob.moc
> > > /home/kdedev/src/kdevelop/lib/plugins/vcs/cvs/cvsjob.h:87: Warning:
> > Class CvsJob inherits from two QObject subclasses VcsJob and KJob. This is not
> > supported!
> > > 
> > > So I also vote for deriving VcsJob from KJob.
> > 
> > Apart from the fact that I wanted to do that anyway: Why is VcsJob a
> > QObject subclass? Who added that? I guess thats local on your hdd right
> > (its not in svn). 
> 
> 
> Well, I was wondering about that too. But it definitely has nothing to 
> do with other changes I made to my local copy. 
> 
> I took a fresh KDevelop checkout and just applyed the changes from the 
> attached patch-file and got the same error.

You've got the wrong order, QObject-derived classes need to be first in
the list of parent classes, so you want

CvsJob : public KJob, public KDevelop::VcsJob

> Could you or somebody else please try to temporary apply the 
> attached patch to his local copy and tell me if you get the
> same error? Or have I done something completely wrong?

Works for me with the above mentioned change, except there's an
ambiguity between VcsJob::exec() and KJob::exec() (you'd have to
re-implement exec() in CvsJob and call KJob::exec() in there).

As I said I think subclassing KJob is ok and actually helps here.

Another thing I just noticed: CVS part uses K3Process to execute cvs,
when you are porting your CvsJob class to VcsJob please also
s/K3Process/QProcess. These two don't play together within the same
application and QProcess has at least one benefit (unified
line-ending-handling across platforms).

Andreas

-- 
A gift of a flower will soon be made to you.




More information about the KDevelop-devel mailing list