Return types of KCompositeJob::removeSubjob() and KJob::removeSubjob()

Richard Dale richard_dale at tipitina.demon.co.uk
Mon Jul 9 23:08:29 BST 2007


On Monday 09 July 2007, Kevin Ottens wrote:
> Le lundi 09 juillet 2007, Richard Dale a écrit :
> > Well C# doesn't like overriden virtual methods with different return
> > types, which is the reason why I asked. I personally find it a bit
> > confusing, but I can special case it ok in C# with a 'new' modifier for
> > the
> > KIO.Job.RemoveSubjob() method.
>
> Well, I'm not overly attached to returning bool in add/removeSubJob(). If
> it's not tested anywhere and is a problem for you, I'm fine if you move to
> void.
Ok, thanks I'll do that. removeSubjob() was only returning false if a dynamic 
cast failed, and so it may be a good idea to add an assert to check for that, 
or a debug log message if the method was changed to return a void. 

When I do bindings I'm not quite sure whether I should just be an observer of 
the KDE c++ api, or an active participant and suggesting changes. For 
instance, if I was doing java bindings I might demand that all operator 
methods be removed, or that all operator methods should have non-operator 
method equivalents (that doesn't seem right to me). On the other hand 
correcting virtual method return types might be ok if it improves the c++ 
api. So covariant c++ return types are certainly ok, but missing return types 
in subclasses just strike me as wrong.

-- Richard





More information about the kde-core-devel mailing list