summaryrefslogtreecommitdiff
path: root/examples/todayplugin
Side-by-side diff
Diffstat (limited to 'examples/todayplugin') (more/less context) (show whitespace changes)
-rw-r--r--examples/todayplugin/exampleplugin.cpp8
-rw-r--r--examples/todayplugin/exampleplugin.h6
2 files changed, 4 insertions, 10 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 @@
*/
#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" );
- }
return m_widget;
}
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
@@ -9,9 +9,6 @@
#ifndef EXAMPLE_PLUGIN_H
#define EXAMPLE_PLUGIN_H
-#include <qwidget.h>
-#include <qguardedptr.h>
-
#include <opie2/todayplugininterface.h>
#include <opie2/todayconfigwidget.h>
@@ -34,9 +31,8 @@ public:
bool excludeFromRefresh() const;
void refresh();
void reinitialize();
-
private:
- QGuardedPtr<ExamplePluginWidget> m_widget;
+ ExamplePluginWidget *m_widget;
};
#endif