[kdev 4] isn't this dangerous?

Matt Rogers mattr at kde.org
Fri Apr 20 12:27:21 UTC 2007


On Friday 20 April 2007 05:59, Jens Herden wrote:
> Hi,
>
> I found this code in lib/interfaces/iplugin.cpp:
>
>
> IPlugin::IPlugin( const KComponentData &instance, QObject *parent )
>
>         : QObject( parent ),
>
>         KXMLGUIClient(), d( new IPluginPrivate )
> {
>     d->core = static_cast<KDevelop::ICore*>(parent);
>     setComponentData( instance );
> }
>
>
> and I wonder why we need the static_cast here. I think it would be saver to
> change the constructer to receive a KDevelop::ICore* instead of a QParent*
>
> Or is there a reason why we can not do this?
>
> Jens

It would be safer. I don't know why we couldn't do this. Hopefully, Alexander 
or Andreas can explain better
-- 
Matt




More information about the KDevelop-devel mailing list