4 files changed, 10 insertions, 3 deletions
diff --git a/libopie2/opieui/otaskbarapplet.h b/libopie2/opieui/otaskbarapplet.h index 686b91a..773aba4 100644 --- a/libopie2/opieui/otaskbarapplet.h +++ b/libopie2/opieui/otaskbarapplet.h | |||
@@ -29,64 +29,66 @@ | |||
29 | 29 | ||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #ifndef OTASKBARAPPLET_H | 32 | #ifndef OTASKBARAPPLET_H |
33 | #define OTASKBARAPPLET_H | 33 | #define OTASKBARAPPLET_H |
34 | 34 | ||
35 | #include <qpe/taskbarappletinterface.h> | 35 | #include <qpe/taskbarappletinterface.h> |
36 | 36 | ||
37 | /*====================================================================================== | 37 | /*====================================================================================== |
38 | * OTaskbarAppletWrapper | 38 | * OTaskbarAppletWrapper |
39 | *======================================================================================*/ | 39 | *======================================================================================*/ |
40 | 40 | ||
41 | template<class T> class OTaskbarAppletWrapper : public TaskbarAppletInterface | 41 | template<class T> class OTaskbarAppletWrapper : public TaskbarAppletInterface |
42 | { | 42 | { |
43 | public: | 43 | public: |
44 | OTaskbarAppletWrapper():_applet( 0 ), ref( 0 ) | 44 | OTaskbarAppletWrapper():_applet( 0 ), ref( 0 ) |
45 | { | 45 | { |
46 | } | 46 | } |
47 | 47 | ||
48 | virtual ~OTaskbarAppletWrapper() | 48 | virtual ~OTaskbarAppletWrapper() |
49 | { | 49 | { |
50 | delete _applet; | 50 | delete _applet; |
51 | } | 51 | } |
52 | 52 | ||
53 | QRESULT queryInterface( const QUuid& uuid, QUnknownInterface** iface ) | 53 | QRESULT queryInterface( const QUuid& uuid, QUnknownInterface** iface ) |
54 | { | 54 | { |
55 | qDebug( "OTaskbarAppletWrapper::queryInterface()" ); | 55 | qDebug( "OTaskbarAppletWrapper::queryInterface()" ); |
56 | *iface = 0; | 56 | *iface = 0; |
57 | if ( uuid == IID_QUnknown ) | 57 | if ( uuid == IID_QUnknown ) |
58 | *iface = this; | 58 | *iface = this; |
59 | else if ( uuid == IID_TaskbarApplet ) | 59 | else if ( uuid == IID_TaskbarApplet ) |
60 | *iface = this; | 60 | *iface = this; |
61 | else | ||
62 | return QS_FALSE; | ||
61 | 63 | ||
62 | if ( *iface ) (*iface)->addRef(); | 64 | if ( *iface ) (*iface)->addRef(); |
63 | return QS_OK; | 65 | return QS_OK; |
64 | } | 66 | } |
65 | 67 | ||
66 | Q_REFCOUNT | 68 | Q_REFCOUNT |
67 | 69 | ||
68 | virtual T* applet( QWidget* parent ) | 70 | virtual T* applet( QWidget* parent ) |
69 | { | 71 | { |
70 | if ( !_applet ) _applet = new T( parent ); | 72 | if ( !_applet ) _applet = new T( parent ); |
71 | return _applet; | 73 | return _applet; |
72 | } | 74 | } |
73 | 75 | ||
74 | virtual int position() const | 76 | virtual int position() const |
75 | { | 77 | { |
76 | return T::position(); | 78 | return T::position(); |
77 | } | 79 | } |
78 | 80 | ||
79 | private: | 81 | private: |
80 | T* _applet; | 82 | T* _applet; |
81 | ulong ref; | 83 | ulong ref; |
82 | }; | 84 | }; |
83 | 85 | ||
84 | #include <qframe.h> | 86 | #include <qframe.h> |
85 | #include <qwidget.h> | 87 | #include <qwidget.h> |
86 | #include <qpe/qpeapplication.h> | 88 | #include <qpe/qpeapplication.h> |
87 | 89 | ||
88 | class QMouseEvent; | 90 | class QMouseEvent; |
89 | 91 | ||
90 | /*====================================================================================== | 92 | /*====================================================================================== |
91 | * OTaskbarApplet | 93 | * OTaskbarApplet |
92 | *======================================================================================*/ | 94 | *======================================================================================*/ |
diff --git a/noncore/todayplugins/fortune/fortunepluginimpl.cpp b/noncore/todayplugins/fortune/fortunepluginimpl.cpp index 466e322..090aaa7 100644 --- a/noncore/todayplugins/fortune/fortunepluginimpl.cpp +++ b/noncore/todayplugins/fortune/fortunepluginimpl.cpp | |||
@@ -9,41 +9,43 @@ | |||
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 | #include "fortuneplugin.h" | 17 | #include "fortuneplugin.h" |
18 | #include "fortunepluginimpl.h" | 18 | #include "fortunepluginimpl.h" |
19 | 19 | ||
20 | FortunePluginImpl::FortunePluginImpl() | 20 | FortunePluginImpl::FortunePluginImpl() |
21 | { | 21 | { |
22 | fortunePlugin = new FortunePlugin(); | 22 | fortunePlugin = new FortunePlugin(); |
23 | } | 23 | } |
24 | 24 | ||
25 | FortunePluginImpl::~FortunePluginImpl() | 25 | FortunePluginImpl::~FortunePluginImpl() |
26 | { | 26 | { |
27 | delete fortunePlugin; | 27 | delete fortunePlugin; |
28 | } | 28 | } |
29 | 29 | ||
30 | 30 | ||
31 | TodayPluginObject* FortunePluginImpl::guiPart() | 31 | TodayPluginObject* FortunePluginImpl::guiPart() |
32 | { | 32 | { |
33 | return fortunePlugin; | 33 | return fortunePlugin; |
34 | } | 34 | } |
35 | 35 | ||
36 | QRESULT FortunePluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) | 36 | QRESULT FortunePluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) |
37 | { | 37 | { |
38 | *iface = 0; | 38 | *iface = 0; |
39 | if ( ( uuid == IID_QUnknown ) || ( uuid == IID_TodayPluginInterface ) ) { | 39 | if ( ( uuid == IID_QUnknown ) || ( uuid == IID_TodayPluginInterface ) ) { |
40 | *iface = this, (*iface)->addRef(); | 40 | *iface = this, (*iface)->addRef(); |
41 | } | 41 | }else |
42 | return QS_FALSE; | ||
43 | |||
42 | return QS_OK; | 44 | return QS_OK; |
43 | 45 | ||
44 | } | 46 | } |
45 | 47 | ||
46 | Q_EXPORT_INTERFACE() | 48 | Q_EXPORT_INTERFACE() |
47 | { | 49 | { |
48 | Q_CREATE_INSTANCE( FortunePluginImpl ); | 50 | Q_CREATE_INSTANCE( FortunePluginImpl ); |
49 | } | 51 | } |
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginimpl.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginimpl.cpp index c17781b..ec3e34d 100644 --- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginimpl.cpp +++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginimpl.cpp | |||
@@ -7,40 +7,42 @@ | |||
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 "stocktickerplugin.h" | 19 | #include "stocktickerplugin.h" |
20 | #include "stocktickerpluginimpl.h" | 20 | #include "stocktickerpluginimpl.h" |
21 | 21 | ||
22 | StockTickerPluginImpl::StockTickerPluginImpl() { | 22 | StockTickerPluginImpl::StockTickerPluginImpl() { |
23 | stocktickerPlugin = new StockTickerPlugin(); | 23 | stocktickerPlugin = new StockTickerPlugin(); |
24 | } | 24 | } |
25 | 25 | ||
26 | StockTickerPluginImpl::~StockTickerPluginImpl() { | 26 | StockTickerPluginImpl::~StockTickerPluginImpl() { |
27 | delete stocktickerPlugin; | 27 | delete stocktickerPlugin; |
28 | } | 28 | } |
29 | 29 | ||
30 | 30 | ||
31 | TodayPluginObject* StockTickerPluginImpl::guiPart() { | 31 | TodayPluginObject* StockTickerPluginImpl::guiPart() { |
32 | return stocktickerPlugin; | 32 | return stocktickerPlugin; |
33 | } | 33 | } |
34 | 34 | ||
35 | QRESULT StockTickerPluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) { | 35 | QRESULT StockTickerPluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) { |
36 | *iface = 0; | 36 | *iface = 0; |
37 | if ( ( uuid == IID_QUnknown ) || ( uuid == IID_TodayPluginInterface ) ) { | 37 | if ( ( uuid == IID_QUnknown ) || ( uuid == IID_TodayPluginInterface ) ) { |
38 | *iface = this, (*iface)->addRef(); | 38 | *iface = this, (*iface)->addRef(); |
39 | } | 39 | }else |
40 | return QS_FALSE; | ||
41 | |||
40 | return QS_OK; | 42 | return QS_OK; |
41 | 43 | ||
42 | } | 44 | } |
43 | 45 | ||
44 | Q_EXPORT_INTERFACE() { | 46 | Q_EXPORT_INTERFACE() { |
45 | Q_CREATE_INSTANCE( StockTickerPluginImpl ); | 47 | Q_CREATE_INSTANCE( StockTickerPluginImpl ); |
46 | } | 48 | } |
diff --git a/noncore/todayplugins/weather/weatherpluginimpl.cpp b/noncore/todayplugins/weather/weatherpluginimpl.cpp index 1a7c27b..fd32a44 100644 --- a/noncore/todayplugins/weather/weatherpluginimpl.cpp +++ b/noncore/todayplugins/weather/weatherpluginimpl.cpp | |||
@@ -22,41 +22,42 @@ | |||
22 | -_. . . )=. = see the file COPYING. If not, write to the | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
23 | -- :-=` Free Software Foundation, Inc., | 23 | -- :-=` Free Software Foundation, Inc., |
24 | 59 Temple Place - Suite 330, | 24 | 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "weatherplugin.h" | 29 | #include "weatherplugin.h" |
30 | #include "weatherpluginimpl.h" | 30 | #include "weatherpluginimpl.h" |
31 | 31 | ||
32 | WeatherPluginImpl::WeatherPluginImpl() | 32 | WeatherPluginImpl::WeatherPluginImpl() |
33 | { | 33 | { |
34 | weatherPlugin = new WeatherPlugin(); | 34 | weatherPlugin = new WeatherPlugin(); |
35 | } | 35 | } |
36 | 36 | ||
37 | WeatherPluginImpl::~WeatherPluginImpl() | 37 | WeatherPluginImpl::~WeatherPluginImpl() |
38 | { | 38 | { |
39 | delete weatherPlugin; | 39 | delete weatherPlugin; |
40 | } | 40 | } |
41 | 41 | ||
42 | 42 | ||
43 | TodayPluginObject* WeatherPluginImpl::guiPart() | 43 | TodayPluginObject* WeatherPluginImpl::guiPart() |
44 | { | 44 | { |
45 | return weatherPlugin; | 45 | return weatherPlugin; |
46 | } | 46 | } |
47 | 47 | ||
48 | QRESULT WeatherPluginImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) | 48 | QRESULT WeatherPluginImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) |
49 | { | 49 | { |
50 | *iface = 0; | 50 | *iface = 0; |
51 | if ( ( uuid == IID_QUnknown ) || ( uuid == IID_TodayPluginInterface ) ) | 51 | if ( ( uuid == IID_QUnknown ) || ( uuid == IID_TodayPluginInterface ) ) |
52 | { | 52 | { |
53 | *iface = this, (*iface)->addRef(); | 53 | *iface = this, (*iface)->addRef(); |
54 | } | 54 | }else |
55 | return QS_FALSE; | ||
55 | 56 | ||
56 | return QS_OK; | 57 | return QS_OK; |
57 | } | 58 | } |
58 | 59 | ||
59 | Q_EXPORT_INTERFACE() | 60 | Q_EXPORT_INTERFACE() |
60 | { | 61 | { |
61 | Q_CREATE_INSTANCE( WeatherPluginImpl ); | 62 | Q_CREATE_INSTANCE( WeatherPluginImpl ); |
62 | } | 63 | } |