KDE/kdevplatform/shell

Andreas Pakulat apaku at gmx.de
Tue Aug 4 09:07:00 UTC 2009


On 04.08.09 11:44:37, Vladimir Prus wrote:
> On Monday 03 August 2009 Andreas Pakulat wrote:
> 
> > SVN commit 1006419 by apaku:
> > 
> > You'd think that if a compiler can choose between two signatures he'd
> > choose the one where he needs fewer implicit conversions. But apparently
> > thats not the case with gcc. This prevents an kind of endless recursion
> > where createPart(KUrl) is called from inside createPart(KUrl).
> > BUG:202397
> > 
> >  M  +1 -1      partcontroller.cpp  
> > 
> > 
> > --- trunk/KDE/kdevplatform/shell/partcontroller.cpp #1006418:1006419
> > @@ -201,7 +201,7 @@
> >      else
> >          mimeType = KMimeType::findByUrl( url );
> >  
> > -    KParts::Part* part = createPart( mimeType->name() );
> > +    KParts::Part* part = IPartController::createPart( mimeType->name() );
> 
> The problem here is that there's no "one that needs fewer implicit conversions".
> IPartController::createPart is hidden by the methods with the same name 
> defined in PartController. FWIW, such hiding of base method is considered to
> be bad, since it breaks is-a relationship. I'd suggest that a right fix is
> to add
> 
> 	using IPartController:createPart;
> 
> in the declaration of PartController.

Well, its not really hidden - at least gcc doesn't warn about the function
being hidden, which it usually does when one method hides another one.

Anyway, will keep that in mind (and change the code accordingly), thanks.

Andreas

-- 
You seek to shield those you love and you like the role of the provider.




More information about the KDevelop-devel mailing list