From kde-commits Wed Jul 02 15:29:03 2008 From: David Faure Date: Wed, 02 Jul 2008 15:29:03 +0000 To: kde-commits Subject: Re: KDE/kdepim/kontact/src Message-Id: <200807021729.04871.dfaure () kdab ! net> X-MARC-Message: https://marc.info/?l=kde-commits&m=121501287922974 On Wednesday 02 July 2008, Rafael Fernández López wrote: > +  factory()->plugActionList( this, QString( "navigator_actionlist" ), > +                             *reinterpret_cast*>( &mActionPlugins ) ); WOW this is ugly! And amazingly dangerous, I would say. mainwindow.h:55:typedef QList ActionPluginList; I would much rather see the code use a QList and cast individual actions to KAction when you really need to use KAction API (to set shortcuts I assume?) Casting a QAction pointer is safe when you know it's a KAction. Side-casting to another type of list is not safe. -- David Faure, faure@kde.org, dfaure@kdab.net KDE/KOffice developer, Qt consultancy projects Klarälvdalens Datakonsult AB, Platform-independent software solutions