[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: gcc -Woverloaded-virtual
From:       David Faure <faure () kde ! org>
Date:       2007-11-25 16:25:38
Message-ID: 200711251725.38436.faure () kde ! org
[Download RAW message or body]

On Saturday 24 November 2007, Aurélien Gâteau wrote:
> class KIO::Job : public KCompositeJob {
> public:
>     virtual void addSubjob(Job*, bool inheritData); /* <- no more default */
>     void addSubjob(Job* job) { addSubjob(job, true); }
> private:
>     using KCompositeJob::addSubjob;
> };

> Note that the "using" line is still necessary because even without the
> overloaded parameter, the signatures of the two methods are still
> different: KCompositeJob::addSubjob() accepts a KJob* while
> KIO::Job::addSubjob() takes a KIO::Job* (this one had me confused for a
> while).

I fixed the slotInfoMessage warning a better way (moving the slot to the
private class since it's unrelated to the one in the base class; I'll commit tomorrow),
but I didn't have a fix for addSubjob/removeSubjob so I'm glad you raise this.
Your post made me realize the argument-type difference... the fact that addSubjob 
takes a KIO::Job and removeSubjob takes a KJob is quite illogical.
I would use KJob for both (since it's virtual anyway) and I would handle 
that correctly in the code (calling the KJob:: methods and not doing the
KIO-specific stuff). I.e. allowing normal KJobs as children of KIO::Jobs instead
of half-forbidding like now. Can you make that change?

-- 
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic