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

List:       kde-commits
Subject:    KDE/kdevelop/lib/interfaces
From:       Andreas Pakulat <apaku () gmx ! de>
Date:       2007-04-21 14:24:48
Message-ID: 1177165488.540380.15617.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 656481 by apaku:

Add a comment explaining why static_cast is needed and why its safe


 M  +6 -0      iplugin.cpp  


--- trunk/KDE/kdevelop/lib/interfaces/iplugin.cpp #656480:656481
@@ -84,6 +84,12 @@
         : QObject( parent ),
         KXMLGUIClient(), d( new IPluginPrivate )
 {
+    // The following cast is safe, there's no component in KDevPlatform that
+    // creates plugins except the plugincontroller. The controller passes 
+    // Core::self() as parent to KServiceTypeTrader::createInstanceFromQuery 
+    // so we know the parent is always a Core* pointer.
+    // This is the only way to pass the Core pointer to the plugin during its 
+    // creation so plugins have access to ICore during their creation.
     d->core = static_cast<KDevelop::ICore*>(parent);
     setComponentData( instance );
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

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