Diffstat (limited to 'examples/todayplugin/exampleplugin.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | examples/todayplugin/exampleplugin.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
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 @@ | |||
6 | */ | 6 | */ |
7 | #include "exampleplugin.h" | 7 | #include "exampleplugin.h" |
8 | 8 | ||
9 | ExamplePlugin::ExamplePlugin() { | 9 | ExamplePlugin::ExamplePlugin() |
10 | m_widget = 0l; | 10 | : m_widget(0l) |
11 | { | ||
11 | } | 12 | } |
12 | 13 | ||
13 | ExamplePlugin::~ExamplePlugin() { | 14 | ExamplePlugin::~ExamplePlugin() { |
14 | delete (ExamplePluginWidget*)m_widget; | ||
15 | } | 15 | } |
16 | 16 | ||
17 | QString ExamplePlugin::pluginName() const { | 17 | QString ExamplePlugin::pluginName() const { |
@@ -28,9 +28,7 @@ QString ExamplePlugin::pixmapNameWidget() const { | |||
28 | } | 28 | } |
29 | 29 | ||
30 | QWidget* ExamplePlugin::widget( QWidget * wid ) { | 30 | QWidget* ExamplePlugin::widget( QWidget * wid ) { |
31 | if(!m_widget) { | ||
32 | m_widget = new ExamplePluginWidget( wid, "Example" ); | 31 | m_widget = new ExamplePluginWidget( wid, "Example" ); |
33 | } | ||
34 | return m_widget; | 32 | return m_widget; |
35 | } | 33 | } |
36 | 34 | ||