From 90aaa298cc69522e88e1f81ade7d5259131b1544 Mon Sep 17 00:00:00 2001 From: zecke Date: Sun, 12 Sep 2004 20:28:36 +0000 Subject: Follow the defined Ownership and have a maybe not needed sanity check --- (limited to 'examples/todayplugin/exampleplugin.cpp') diff --git a/examples/todayplugin/exampleplugin.cpp b/examples/todayplugin/exampleplugin.cpp index 94a5836..41bbfe2 100644 --- a/examples/todayplugin/exampleplugin.cpp +++ b/examples/todayplugin/exampleplugin.cpp @@ -6,12 +6,12 @@ */ #include "exampleplugin.h" -ExamplePlugin::ExamplePlugin() { - m_widget = 0l; +ExamplePlugin::ExamplePlugin() + : m_widget(0l) +{ } ExamplePlugin::~ExamplePlugin() { - delete (ExamplePluginWidget*)m_widget; } QString ExamplePlugin::pluginName() const { @@ -28,9 +28,7 @@ QString ExamplePlugin::pixmapNameWidget() const { } QWidget* ExamplePlugin::widget( QWidget * wid ) { - if(!m_widget) { - m_widget = new ExamplePluginWidget( wid, "Example" ); - } + m_widget = new ExamplePluginWidget( wid, "Example" ); return m_widget; } -- cgit v0.9.0.2