author | zecke <zecke> | 2004-09-12 20:28:36 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-09-12 20:28:36 (UTC) |
commit | 90aaa298cc69522e88e1f81ade7d5259131b1544 (patch) (unidiff) | |
tree | 86bdb0a2bb94938754ba94f2ded9dc6ec5fb5207 /examples | |
parent | 00952f16786dcd069820e45df83a00b6c477893b (diff) | |
download | opie-90aaa298cc69522e88e1f81ade7d5259131b1544.zip opie-90aaa298cc69522e88e1f81ade7d5259131b1544.tar.gz opie-90aaa298cc69522e88e1f81ade7d5259131b1544.tar.bz2 |
Follow the defined Ownership and have a maybe not needed
sanity check
-rw-r--r-- | examples/todayplugin/exampleplugin.cpp | 10 | ||||
-rw-r--r-- | examples/todayplugin/exampleplugin.h | 8 |
2 files changed, 6 insertions, 12 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 | |||
@@ -7,10 +7,10 @@ | |||
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 | ||
@@ -29,7 +29,5 @@ QString ExamplePlugin::pixmapNameWidget() const { | |||
29 | 29 | ||
30 | QWidget* ExamplePlugin::widget( QWidget * wid ) { | 30 | QWidget* ExamplePlugin::widget( QWidget * wid ) { |
31 | if(!m_widget) { | 31 | m_widget = new ExamplePluginWidget( wid, "Example" ); |
32 | m_widget = new ExamplePluginWidget( wid, "Example" ); | ||
33 | } | ||
34 | return m_widget; | 32 | return m_widget; |
35 | } | 33 | } |
diff --git a/examples/todayplugin/exampleplugin.h b/examples/todayplugin/exampleplugin.h index 94f5b37..90d3485 100644 --- a/examples/todayplugin/exampleplugin.h +++ b/examples/todayplugin/exampleplugin.h | |||
@@ -10,7 +10,4 @@ | |||
10 | #define EXAMPLE_PLUGIN_H | 10 | #define EXAMPLE_PLUGIN_H |
11 | 11 | ||
12 | #include <qwidget.h> | ||
13 | #include <qguardedptr.h> | ||
14 | |||
15 | #include <opie2/todayplugininterface.h> | 12 | #include <opie2/todayplugininterface.h> |
16 | #include <opie2/todayconfigwidget.h> | 13 | #include <opie2/todayconfigwidget.h> |
@@ -35,7 +32,6 @@ public: | |||
35 | void refresh(); | 32 | void refresh(); |
36 | void reinitialize(); | 33 | void reinitialize(); |
37 | 34 | private: | |
38 | private: | 35 | ExamplePluginWidget *m_widget; |
39 | QGuardedPtr<ExamplePluginWidget> m_widget; | ||
40 | }; | 36 | }; |
41 | 37 | ||