Diffstat (limited to 'core/pim/today/plugins/todolist/todoplugin.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/today/plugins/todolist/todoplugin.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/core/pim/today/plugins/todolist/todoplugin.cpp b/core/pim/today/plugins/todolist/todoplugin.cpp index b5abbd3..1238f92 100644 --- a/core/pim/today/plugins/todolist/todoplugin.cpp +++ b/core/pim/today/plugins/todolist/todoplugin.cpp | |||
@@ -9,53 +9,63 @@ | |||
9 | * * | 9 | * * |
10 | * This program is free software; you can redistribute it and/or modify * | 10 | * This program is free software; you can redistribute it and/or modify * |
11 | * it under the terms of the GNU General Public License as published by * | 11 | * it under the terms of the GNU General Public License as published by * |
12 | * the Free Software Foundation; either version 2 of the License, or * | 12 | * the Free Software Foundation; either version 2 of the License, or * |
13 | * (at your option) any later version. * | 13 | * (at your option) any later version. * |
14 | * * | 14 | * * |
15 | ***************************************************************************/ | 15 | ***************************************************************************/ |
16 | 16 | ||
17 | 17 | ||
18 | 18 | ||
19 | #include "todoplugin.h" | 19 | #include "todoplugin.h" |
20 | #include "todopluginconfig.h" | 20 | #include "todopluginconfig.h" |
21 | #include "todopluginwidget.h" | ||
22 | 21 | ||
23 | 22 | ||
24 | TodolistPlugin::TodolistPlugin() { | 23 | TodolistPlugin::TodolistPlugin() { |
24 | m_widget = 0l; | ||
25 | } | 25 | } |
26 | 26 | ||
27 | TodolistPlugin::~TodolistPlugin() { | 27 | TodolistPlugin::~TodolistPlugin() { |
28 | delete m_widget; | ||
28 | } | 29 | } |
29 | 30 | ||
30 | QString TodolistPlugin::pluginName() const { | 31 | QString TodolistPlugin::pluginName() const { |
31 | return QObject::tr( "Todolist plugin" ); | 32 | return QObject::tr( "Todolist plugin" ); |
32 | } | 33 | } |
33 | 34 | ||
34 | double TodolistPlugin::versionNumber() const { | 35 | double TodolistPlugin::versionNumber() const { |
35 | return 0.8; | 36 | return 0.9; |
36 | } | 37 | } |
37 | 38 | ||
38 | QString TodolistPlugin::pixmapNameWidget() const { | 39 | QString TodolistPlugin::pixmapNameWidget() const { |
39 | return "TodoList"; | 40 | return "TodoList"; |
40 | } | 41 | } |
41 | 42 | ||
42 | QWidget* TodolistPlugin::widget( QWidget *wid ) { | 43 | QWidget* TodolistPlugin::widget( QWidget *wid ) { |
43 | return new TodolistPluginWidget( wid, "Todolist" ); | 44 | if(!m_widget) { |
45 | m_widget = new TodolistPluginWidget( wid, "Todolist" ); | ||
46 | } | ||
47 | return m_widget; | ||
44 | } | 48 | } |
45 | 49 | ||
46 | QString TodolistPlugin::pixmapNameConfig() const { | 50 | QString TodolistPlugin::pixmapNameConfig() const { |
47 | return "TodoList"; | 51 | return "TodoList"; |
48 | } | 52 | } |
49 | 53 | ||
50 | TodayConfigWidget* TodolistPlugin::configWidget( QWidget* wid ) { | 54 | TodayConfigWidget* TodolistPlugin::configWidget( QWidget* wid ) { |
51 | return new TodolistPluginConfig( wid , "Todolist" ); | 55 | return new TodolistPluginConfig( wid , "Todolist" ); |
52 | } | 56 | } |
53 | 57 | ||
54 | QString TodolistPlugin::appName() const { | 58 | QString TodolistPlugin::appName() const { |
55 | return "todolist"; | 59 | return "todolist"; |
56 | } | 60 | } |
57 | 61 | ||
58 | 62 | ||
59 | bool TodolistPlugin::excludeFromRefresh() const { | 63 | bool TodolistPlugin::excludeFromRefresh() const { |
60 | return false; | 64 | return false; |
61 | } | 65 | } |
66 | |||
67 | void TodolistPlugin::refresh() { | ||
68 | if ( m_widget ) { | ||
69 | m_widget->refresh(); | ||
70 | } | ||
71 | } | ||