[Marble-commits] KDE/kdeedu/marble/src/plugins/render/stars
Dennis Nienhüser
earthwings at gentoo.org
Sun Sep 26 09:51:21 CEST 2010
SVN commit 1179732 by nienhueser:
Replace the c-style cast with a dynamic_cast and check its result. You cannot rely on the paint device being the marble widget, this is not true if the widget is disabled, for example.
CCBUG: 252146
M +2 -2 StarsPlugin.cpp
--- trunk/KDE/kdeedu/marble/src/plugins/render/stars/StarsPlugin.cpp #1179731:1179732
@@ -226,8 +226,8 @@
if( renderPos == "ALWAYS_ON_TOP" )
{
- m_marbleWidget = ( MarbleWidget* )painter->device();
- if( m_marbleWidget->sunLocator()->getCentered() == true )
+ m_marbleWidget = dynamic_cast<MarbleWidget*>( painter->device() );
+ if( m_marbleWidget && m_marbleWidget->sunLocator()->getCentered() == true )
{
GeoDataCoordinates point( m_marbleWidget->sunLocator()->getLon(), m_marbleWidget->sunLocator()->getLat(), 0, GeoDataCoordinates::Degree );
QImage image( MarbleDirs::path( "svg/sunshine.png" ) );
More information about the Marble-commits
mailing list