Diffstat (limited to 'core/pim/today/plugins/datebook/datebookplugin.cpp') (more/less context) (show 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 | |||
@@ -1,62 +1,72 @@ | |||
1 | 1 | ||
2 | /* | 2 | /* |
3 | * datebookplugin.cpp | 3 | * datebookplugin.cpp |
4 | * | 4 | * |
5 | * copyright : (c) 2002 by Maximilian Reiß | 5 | * copyright : (c) 2002 by Maximilian Reiß |
6 | * email : harlekin@handhelds.org | 6 | * email : harlekin@handhelds.org |
7 | * | 7 | * |
8 | */ | 8 | */ |
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * (at your option) any later version. * | 14 | * (at your option) any later version. * |
15 | * * | 15 | * * |
16 | ***************************************************************************/ | 16 | ***************************************************************************/ |
17 | 17 | ||
18 | 18 | ||
19 | 19 | ||
20 | #include "datebookevent.h" | 20 | #include "datebookevent.h" |
21 | #include "datebookplugin.h" | 21 | #include "datebookplugin.h" |
22 | #include "datebookpluginwidget.h" | ||
23 | #include "datebookpluginconfig.h" | 22 | #include "datebookpluginconfig.h" |
24 | 23 | ||
25 | 24 | ||
26 | DatebookPlugin::DatebookPlugin() { | 25 | DatebookPlugin::DatebookPlugin() { |
26 | m_widget = 0; | ||
27 | } | 27 | } |
28 | 28 | ||
29 | DatebookPlugin::~DatebookPlugin() { | 29 | DatebookPlugin::~DatebookPlugin() { |
30 | delete m_widget; | ||
30 | } | 31 | } |
31 | 32 | ||
32 | QString DatebookPlugin::pluginName() const { | 33 | QString DatebookPlugin::pluginName() const { |
33 | return QObject::tr( "Datebook plugin"); | 34 | return QObject::tr( "Datebook plugin"); |
34 | } | 35 | } |
35 | 36 | ||
36 | double DatebookPlugin::versionNumber() const { | 37 | double DatebookPlugin::versionNumber() const { |
37 | return 1.0; | 38 | return 1.0; |
38 | } | 39 | } |
39 | 40 | ||
40 | QString DatebookPlugin::pixmapNameWidget() const { | 41 | QString DatebookPlugin::pixmapNameWidget() const { |
41 | return "DateBook"; | 42 | return "DateBook"; |
42 | } | 43 | } |
43 | 44 | ||
44 | QWidget* DatebookPlugin::widget( QWidget* wid ) { | 45 | QWidget* DatebookPlugin::widget( QWidget* wid ) { |
45 | return new DatebookPluginWidget( wid, "Datebook" ); | 46 | if(!m_widget) { |
47 | m_widget = new DatebookPluginWidget( wid, "Datebook" ); | ||
48 | } | ||
49 | return m_widget; | ||
46 | } | 50 | } |
47 | 51 | ||
48 | QString DatebookPlugin::pixmapNameConfig() const { | 52 | QString DatebookPlugin::pixmapNameConfig() const { |
49 | return "DateBook"; | 53 | return "DateBook"; |
50 | } | 54 | } |
51 | 55 | ||
52 | TodayConfigWidget* DatebookPlugin::configWidget( QWidget* wid ) { | 56 | TodayConfigWidget* DatebookPlugin::configWidget( QWidget* wid ) { |
53 | return new DatebookPluginConfig( wid , "Datebook" ); | 57 | return new DatebookPluginConfig( wid , "Datebook" ); |
54 | } | 58 | } |
55 | 59 | ||
56 | QString DatebookPlugin::appName() const { | 60 | QString DatebookPlugin::appName() const { |
57 | return "datebook"; | 61 | return "datebook"; |
58 | } | 62 | } |
59 | 63 | ||
60 | bool DatebookPlugin::excludeFromRefresh() const { | 64 | bool DatebookPlugin::excludeFromRefresh() const { |
61 | return false; | 65 | return false; |
62 | } | 66 | } |
67 | |||
68 | void DatebookPlugin::refresh() { | ||
69 | if ( m_widget ) { | ||
70 | m_widget->refresh(); | ||
71 | } | ||
72 | } | ||