Diffstat (limited to 'examples/todayplugin/exampleplugin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | examples/todayplugin/exampleplugin.cpp | 10 |
1 files changed, 4 insertions, 6 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 | |||
@@ -3,18 +3,18 @@ | |||
3 | * | 3 | * |
4 | * email : harlekin@handhelds.org | 4 | * email : harlekin@handhelds.org |
5 | * | 5 | * |
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 { |
18 | return QObject::tr( "Example plugin" ); | 18 | return QObject::tr( "Example plugin" ); |
19 | } | 19 | } |
20 | 20 | ||
@@ -25,15 +25,13 @@ double ExamplePlugin::versionNumber() const { | |||
25 | // this sets the image that will be shown on the left side of the plugin | 25 | // this sets the image that will be shown on the left side of the plugin |
26 | QString ExamplePlugin::pixmapNameWidget() const { | 26 | QString ExamplePlugin::pixmapNameWidget() const { |
27 | return QString::fromLatin1("Tux"); | 27 | return QString::fromLatin1("Tux"); |
28 | } | 28 | } |
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 | } |
36 | 34 | ||
37 | 35 | ||
38 | // that would be the icon of the config widget in todays config view | 36 | // that would be the icon of the config widget in todays config view |
39 | QString ExamplePlugin::pixmapNameConfig() const { | 37 | QString ExamplePlugin::pixmapNameConfig() const { |