Diffstat (limited to 'core/pim/today/plugins/datebook/datebookplugin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/today/plugins/datebook/datebookplugin.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/core/pim/today/plugins/datebook/datebookplugin.cpp b/core/pim/today/plugins/datebook/datebookplugin.cpp index eda84be..2ac7d01 100644 --- a/core/pim/today/plugins/datebook/datebookplugin.cpp +++ b/core/pim/today/plugins/datebook/datebookplugin.cpp @@ -18,16 +18,17 @@ #include "datebookevent.h" #include "datebookplugin.h" -#include "datebookpluginwidget.h" #include "datebookpluginconfig.h" DatebookPlugin::DatebookPlugin() { + m_widget = 0; } DatebookPlugin::~DatebookPlugin() { + delete m_widget; } QString DatebookPlugin::pluginName() const { return QObject::tr( "Datebook plugin"); @@ -41,9 +42,12 @@ QString DatebookPlugin::pixmapNameWidget() const { return "DateBook"; } QWidget* DatebookPlugin::widget( QWidget* wid ) { - return new DatebookPluginWidget( wid, "Datebook" ); + if(!m_widget) { + m_widget = new DatebookPluginWidget( wid, "Datebook" ); + } + return m_widget; } QString DatebookPlugin::pixmapNameConfig() const { return "DateBook"; @@ -59,4 +63,10 @@ QString DatebookPlugin::appName() const { bool DatebookPlugin::excludeFromRefresh() const { return false; } + +void DatebookPlugin::refresh() { + if ( m_widget ) { + m_widget->refresh(); + } +} |