author | zecke <zecke> | 2003-02-10 22:02:47 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-02-10 22:02:47 (UTC) |
commit | 51452f8478edb77ed1eef61adff314c2d239712f (patch) (unidiff) | |
tree | bc301c77096a7c681623806f7409755ceaafac39 | |
parent | eb9be7ada3de060d8c5ce52590bd91120ed5e1bd (diff) | |
download | opie-51452f8478edb77ed1eef61adff314c2d239712f.zip opie-51452f8478edb77ed1eef61adff314c2d239712f.tar.gz opie-51452f8478edb77ed1eef61adff314c2d239712f.tar.bz2 |
make use of QGuardedPtr
-rw-r--r-- | core/pim/today/plugins/datebook/datebookplugin.cpp | 3 | ||||
-rw-r--r-- | core/pim/today/plugins/datebook/datebookplugin.h | 3 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todoplugin.cpp | 3 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todoplugin.h | 3 |
4 files changed, 6 insertions, 6 deletions
diff --git a/core/pim/today/plugins/datebook/datebookplugin.cpp b/core/pim/today/plugins/datebook/datebookplugin.cpp index 2ac7d01..f095478 100644 --- a/core/pim/today/plugins/datebook/datebookplugin.cpp +++ b/core/pim/today/plugins/datebook/datebookplugin.cpp | |||
@@ -1,72 +1,71 @@ | |||
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 "datebookpluginconfig.h" | 22 | #include "datebookpluginconfig.h" |
23 | 23 | ||
24 | 24 | ||
25 | DatebookPlugin::DatebookPlugin() { | 25 | DatebookPlugin::DatebookPlugin() { |
26 | m_widget = 0; | ||
27 | } | 26 | } |
28 | 27 | ||
29 | DatebookPlugin::~DatebookPlugin() { | 28 | DatebookPlugin::~DatebookPlugin() { |
30 | delete m_widget; | 29 | delete (DatebookPluginWidget*)m_widget; |
31 | } | 30 | } |
32 | 31 | ||
33 | QString DatebookPlugin::pluginName() const { | 32 | QString DatebookPlugin::pluginName() const { |
34 | return QObject::tr( "Datebook plugin"); | 33 | return QObject::tr( "Datebook plugin"); |
35 | } | 34 | } |
36 | 35 | ||
37 | double DatebookPlugin::versionNumber() const { | 36 | double DatebookPlugin::versionNumber() const { |
38 | return 1.0; | 37 | return 1.0; |
39 | } | 38 | } |
40 | 39 | ||
41 | QString DatebookPlugin::pixmapNameWidget() const { | 40 | QString DatebookPlugin::pixmapNameWidget() const { |
42 | return "DateBook"; | 41 | return "DateBook"; |
43 | } | 42 | } |
44 | 43 | ||
45 | QWidget* DatebookPlugin::widget( QWidget* wid ) { | 44 | QWidget* DatebookPlugin::widget( QWidget* wid ) { |
46 | if(!m_widget) { | 45 | if(!m_widget) { |
47 | m_widget = new DatebookPluginWidget( wid, "Datebook" ); | 46 | m_widget = new DatebookPluginWidget( wid, "Datebook" ); |
48 | } | 47 | } |
49 | return m_widget; | 48 | return m_widget; |
50 | } | 49 | } |
51 | 50 | ||
52 | QString DatebookPlugin::pixmapNameConfig() const { | 51 | QString DatebookPlugin::pixmapNameConfig() const { |
53 | return "DateBook"; | 52 | return "DateBook"; |
54 | } | 53 | } |
55 | 54 | ||
56 | TodayConfigWidget* DatebookPlugin::configWidget( QWidget* wid ) { | 55 | TodayConfigWidget* DatebookPlugin::configWidget( QWidget* wid ) { |
57 | return new DatebookPluginConfig( wid , "Datebook" ); | 56 | return new DatebookPluginConfig( wid , "Datebook" ); |
58 | } | 57 | } |
59 | 58 | ||
60 | QString DatebookPlugin::appName() const { | 59 | QString DatebookPlugin::appName() const { |
61 | return "datebook"; | 60 | return "datebook"; |
62 | } | 61 | } |
63 | 62 | ||
64 | bool DatebookPlugin::excludeFromRefresh() const { | 63 | bool DatebookPlugin::excludeFromRefresh() const { |
65 | return false; | 64 | return false; |
66 | } | 65 | } |
67 | 66 | ||
68 | void DatebookPlugin::refresh() { | 67 | void DatebookPlugin::refresh() { |
69 | if ( m_widget ) { | 68 | if ( m_widget ) { |
70 | m_widget->refresh(); | 69 | m_widget->refresh(); |
71 | } | 70 | } |
72 | } | 71 | } |
diff --git a/core/pim/today/plugins/datebook/datebookplugin.h b/core/pim/today/plugins/datebook/datebookplugin.h index 644a614..eb7a401 100644 --- a/core/pim/today/plugins/datebook/datebookplugin.h +++ b/core/pim/today/plugins/datebook/datebookplugin.h | |||
@@ -1,49 +1,50 @@ | |||
1 | /* | 1 | /* |
2 | * datebookplugin.h | 2 | * datebookplugin.h |
3 | * | 3 | * |
4 | * copyright : (c) 2002 by Maximilian Reiß | 4 | * copyright : (c) 2002 by Maximilian Reiß |
5 | * email : harlekin@handhelds.org | 5 | * email : harlekin@handhelds.org |
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | /*************************************************************************** | 8 | /*************************************************************************** |
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 | #ifndef DATEBOOK_PLUGIN_H | 17 | #ifndef DATEBOOK_PLUGIN_H |
18 | #define DATEBOOK_PLUGIN_H | 18 | #define DATEBOOK_PLUGIN_H |
19 | 19 | ||
20 | #include <qstring.h> | 20 | #include <qstring.h> |
21 | #include <qguardedptr.h> | ||
21 | #include <qwidget.h> | 22 | #include <qwidget.h> |
22 | 23 | ||
23 | #include <opie/oclickablelabel.h> | 24 | #include <opie/oclickablelabel.h> |
24 | #include <opie/todayplugininterface.h> | 25 | #include <opie/todayplugininterface.h> |
25 | 26 | ||
26 | #include "datebookpluginwidget.h" | 27 | #include "datebookpluginwidget.h" |
27 | 28 | ||
28 | class DatebookPlugin : public TodayPluginObject { | 29 | class DatebookPlugin : public TodayPluginObject { |
29 | 30 | ||
30 | public: | 31 | public: |
31 | DatebookPlugin(); | 32 | DatebookPlugin(); |
32 | ~DatebookPlugin(); | 33 | ~DatebookPlugin(); |
33 | 34 | ||
34 | QString pluginName() const; | 35 | QString pluginName() const; |
35 | double versionNumber() const; | 36 | double versionNumber() const; |
36 | QString pixmapNameWidget() const; | 37 | QString pixmapNameWidget() const; |
37 | QWidget* widget( QWidget *); | 38 | QWidget* widget( QWidget *); |
38 | QString pixmapNameConfig() const; | 39 | QString pixmapNameConfig() const; |
39 | TodayConfigWidget* configWidget( QWidget *); | 40 | TodayConfigWidget* configWidget( QWidget *); |
40 | QString appName() const; | 41 | QString appName() const; |
41 | bool excludeFromRefresh() const; | 42 | bool excludeFromRefresh() const; |
42 | void refresh(); | 43 | void refresh(); |
43 | 44 | ||
44 | private: | 45 | private: |
45 | DatebookPluginWidget *m_widget; | 46 | QGuardedPtr<DatebookPluginWidget> m_widget; |
46 | }; | 47 | }; |
47 | 48 | ||
48 | 49 | ||
49 | #endif | 50 | #endif |
diff --git a/core/pim/today/plugins/todolist/todoplugin.cpp b/core/pim/today/plugins/todolist/todoplugin.cpp index 1238f92..bff0eba 100644 --- a/core/pim/today/plugins/todolist/todoplugin.cpp +++ b/core/pim/today/plugins/todolist/todoplugin.cpp | |||
@@ -1,71 +1,70 @@ | |||
1 | /* | 1 | /* |
2 | * todoplugin.cpp | 2 | * todoplugin.cpp |
3 | * | 3 | * |
4 | * copyright : (c) 2002 by Maximilian Reiß | 4 | * copyright : (c) 2002 by Maximilian Reiß |
5 | * email : harlekin@handhelds.org | 5 | * email : harlekin@handhelds.org |
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | /*************************************************************************** | 8 | /*************************************************************************** |
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 | 21 | ||
22 | 22 | ||
23 | TodolistPlugin::TodolistPlugin() { | 23 | TodolistPlugin::TodolistPlugin() { |
24 | m_widget = 0l; | ||
25 | } | 24 | } |
26 | 25 | ||
27 | TodolistPlugin::~TodolistPlugin() { | 26 | TodolistPlugin::~TodolistPlugin() { |
28 | delete m_widget; | 27 | delete (TodolistPluginWidget*)m_widget; |
29 | } | 28 | } |
30 | 29 | ||
31 | QString TodolistPlugin::pluginName() const { | 30 | QString TodolistPlugin::pluginName() const { |
32 | return QObject::tr( "Todolist plugin" ); | 31 | return QObject::tr( "Todolist plugin" ); |
33 | } | 32 | } |
34 | 33 | ||
35 | double TodolistPlugin::versionNumber() const { | 34 | double TodolistPlugin::versionNumber() const { |
36 | return 0.9; | 35 | return 0.9; |
37 | } | 36 | } |
38 | 37 | ||
39 | QString TodolistPlugin::pixmapNameWidget() const { | 38 | QString TodolistPlugin::pixmapNameWidget() const { |
40 | return "TodoList"; | 39 | return "TodoList"; |
41 | } | 40 | } |
42 | 41 | ||
43 | QWidget* TodolistPlugin::widget( QWidget *wid ) { | 42 | QWidget* TodolistPlugin::widget( QWidget *wid ) { |
44 | if(!m_widget) { | 43 | if(!m_widget) { |
45 | m_widget = new TodolistPluginWidget( wid, "Todolist" ); | 44 | m_widget = new TodolistPluginWidget( wid, "Todolist" ); |
46 | } | 45 | } |
47 | return m_widget; | 46 | return m_widget; |
48 | } | 47 | } |
49 | 48 | ||
50 | QString TodolistPlugin::pixmapNameConfig() const { | 49 | QString TodolistPlugin::pixmapNameConfig() const { |
51 | return "TodoList"; | 50 | return "TodoList"; |
52 | } | 51 | } |
53 | 52 | ||
54 | TodayConfigWidget* TodolistPlugin::configWidget( QWidget* wid ) { | 53 | TodayConfigWidget* TodolistPlugin::configWidget( QWidget* wid ) { |
55 | return new TodolistPluginConfig( wid , "Todolist" ); | 54 | return new TodolistPluginConfig( wid , "Todolist" ); |
56 | } | 55 | } |
57 | 56 | ||
58 | QString TodolistPlugin::appName() const { | 57 | QString TodolistPlugin::appName() const { |
59 | return "todolist"; | 58 | return "todolist"; |
60 | } | 59 | } |
61 | 60 | ||
62 | 61 | ||
63 | bool TodolistPlugin::excludeFromRefresh() const { | 62 | bool TodolistPlugin::excludeFromRefresh() const { |
64 | return false; | 63 | return false; |
65 | } | 64 | } |
66 | 65 | ||
67 | void TodolistPlugin::refresh() { | 66 | void TodolistPlugin::refresh() { |
68 | if ( m_widget ) { | 67 | if ( m_widget ) { |
69 | m_widget->refresh(); | 68 | m_widget->refresh(); |
70 | } | 69 | } |
71 | } | 70 | } |
diff --git a/core/pim/today/plugins/todolist/todoplugin.h b/core/pim/today/plugins/todolist/todoplugin.h index 6106d0c..7a2235c 100644 --- a/core/pim/today/plugins/todolist/todoplugin.h +++ b/core/pim/today/plugins/todolist/todoplugin.h | |||
@@ -1,49 +1,50 @@ | |||
1 | /* | 1 | /* |
2 | * todoplugin.h | 2 | * todoplugin.h |
3 | * | 3 | * |
4 | * copyright : (c) 2002 by Maximilian Reiß | 4 | * copyright : (c) 2002 by Maximilian Reiß |
5 | * email : harlekin@handhelds.org | 5 | * email : harlekin@handhelds.org |
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | /*************************************************************************** | 8 | /*************************************************************************** |
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 | #ifndef TODOLIST_PLUGIN_H | 17 | #ifndef TODOLIST_PLUGIN_H |
18 | #define TODOLIST_PLUGIN_H | 18 | #define TODOLIST_PLUGIN_H |
19 | 19 | ||
20 | #include <qstring.h> | 20 | #include <qstring.h> |
21 | #include <qguardedptr.h> | ||
21 | #include <qwidget.h> | 22 | #include <qwidget.h> |
22 | 23 | ||
23 | #include <opie/tododb.h> | 24 | #include <opie/tododb.h> |
24 | #include <opie/oclickablelabel.h> | 25 | #include <opie/oclickablelabel.h> |
25 | #include <opie/todayplugininterface.h> | 26 | #include <opie/todayplugininterface.h> |
26 | 27 | ||
27 | #include "todopluginwidget.h" | 28 | #include "todopluginwidget.h" |
28 | 29 | ||
29 | class TodolistPlugin : public TodayPluginObject { | 30 | class TodolistPlugin : public TodayPluginObject { |
30 | 31 | ||
31 | public: | 32 | public: |
32 | TodolistPlugin(); | 33 | TodolistPlugin(); |
33 | ~TodolistPlugin(); | 34 | ~TodolistPlugin(); |
34 | 35 | ||
35 | QString pluginName() const; | 36 | QString pluginName() const; |
36 | double versionNumber() const; | 37 | double versionNumber() const; |
37 | QString pixmapNameWidget() const; | 38 | QString pixmapNameWidget() const; |
38 | QWidget* widget(QWidget *); | 39 | QWidget* widget(QWidget *); |
39 | QString pixmapNameConfig() const; | 40 | QString pixmapNameConfig() const; |
40 | TodayConfigWidget* configWidget(QWidget *); | 41 | TodayConfigWidget* configWidget(QWidget *); |
41 | QString appName() const; | 42 | QString appName() const; |
42 | bool excludeFromRefresh() const; | 43 | bool excludeFromRefresh() const; |
43 | void refresh(); | 44 | void refresh(); |
44 | 45 | ||
45 | private: | 46 | private: |
46 | TodolistPluginWidget *m_widget; | 47 | QGuardedPtr<TodolistPluginWidget> m_widget; |
47 | }; | 48 | }; |
48 | 49 | ||
49 | #endif | 50 | #endif |