author | mickeyl <mickeyl> | 2004-03-01 19:19:37 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-03-01 19:19:37 (UTC) |
commit | ddc3d749af5f7afebf69488b79641771fe246b5b (patch) (unidiff) | |
tree | 8ea8614906c568e4677493ef09040724d60dd2d4 /core/applets/clipboardapplet | |
parent | fb0981f47e529f9d1dd77fa005ffa3c3ecedff67 (diff) | |
download | opie-ddc3d749af5f7afebf69488b79641771fe246b5b.zip opie-ddc3d749af5f7afebf69488b79641771fe246b5b.tar.gz opie-ddc3d749af5f7afebf69488b79641771fe246b5b.tar.bz2 |
remove duplicated boiler plate code in favour of the OTaskbarApplet template
Diffstat (limited to 'core/applets/clipboardapplet') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/applets/clipboardapplet/clipboard.cpp | 11 | ||||
-rw-r--r-- | core/applets/clipboardapplet/clipboard.h | 1 | ||||
-rw-r--r-- | core/applets/clipboardapplet/clipboardapplet.pro | 4 | ||||
-rw-r--r-- | core/applets/clipboardapplet/clipboardappletimpl.cpp | 66 | ||||
-rw-r--r-- | core/applets/clipboardapplet/clipboardappletimpl.h | 43 |
5 files changed, 14 insertions, 111 deletions
diff --git a/core/applets/clipboardapplet/clipboard.cpp b/core/applets/clipboardapplet/clipboard.cpp index bb0db9b..34d151e 100644 --- a/core/applets/clipboardapplet/clipboard.cpp +++ b/core/applets/clipboardapplet/clipboard.cpp | |||
@@ -22,2 +22,3 @@ | |||
22 | 22 | ||
23 | #include <opie2/otaskbarapplet.h> | ||
23 | #include <qpe/resource.h> | 24 | #include <qpe/resource.h> |
@@ -62,2 +63,7 @@ ClipboardApplet::~ClipboardApplet ( ) | |||
62 | 63 | ||
64 | int ClipboardApplet::position() | ||
65 | { | ||
66 | return 6; | ||
67 | } | ||
68 | |||
63 | void ClipboardApplet::shutdown ( ) | 69 | void ClipboardApplet::shutdown ( ) |
@@ -178 +184,6 @@ void ClipboardApplet::newData ( ) | |||
178 | } | 184 | } |
185 | |||
186 | Q_EXPORT_INTERFACE() | ||
187 | { | ||
188 | Q_CREATE_INSTANCE( OTaskbarAppletWrapper<ClipboardApplet> ); | ||
189 | } | ||
diff --git a/core/applets/clipboardapplet/clipboard.h b/core/applets/clipboardapplet/clipboard.h index ec87d39..bbda0ff 100644 --- a/core/applets/clipboardapplet/clipboard.h +++ b/core/applets/clipboardapplet/clipboard.h | |||
@@ -34,2 +34,3 @@ public: | |||
34 | ~ClipboardApplet ( ); | 34 | ~ClipboardApplet ( ); |
35 | static int position(); | ||
35 | 36 | ||
diff --git a/core/applets/clipboardapplet/clipboardapplet.pro b/core/applets/clipboardapplet/clipboardapplet.pro index f6842a2..74cf48c 100644 --- a/core/applets/clipboardapplet/clipboardapplet.pro +++ b/core/applets/clipboardapplet/clipboardapplet.pro | |||
@@ -2,4 +2,4 @@ TEMPLATE = lib | |||
2 | CONFIG += qt plugin warn_on release | 2 | CONFIG += qt plugin warn_on release |
3 | HEADERS= clipboard.h clipboardappletimpl.h | 3 | HEADERS = clipboard.h |
4 | SOURCES= clipboard.cpp clipboardappletimpl.cpp | 4 | SOURCES = clipboard.cpp |
5 | TARGET = clipboardapplet | 5 | TARGET = clipboardapplet |
diff --git a/core/applets/clipboardapplet/clipboardappletimpl.cpp b/core/applets/clipboardapplet/clipboardappletimpl.cpp deleted file mode 100644 index f454529..0000000 --- a/core/applets/clipboardapplet/clipboardappletimpl.cpp +++ b/dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #include "clipboard.h" | ||
21 | #include "clipboardappletimpl.h" | ||
22 | |||
23 | |||
24 | ClipboardAppletImpl::ClipboardAppletImpl() | ||
25 | : clipboard(0) | ||
26 | { | ||
27 | } | ||
28 | |||
29 | ClipboardAppletImpl::~ClipboardAppletImpl() | ||
30 | { | ||
31 | delete clipboard; | ||
32 | } | ||
33 | |||
34 | QWidget *ClipboardAppletImpl::applet( QWidget *parent ) | ||
35 | { | ||
36 | if ( !clipboard ) | ||
37 | clipboard = new ClipboardApplet( parent ); | ||
38 | return clipboard; | ||
39 | } | ||
40 | |||
41 | int ClipboardAppletImpl::position() const | ||
42 | { | ||
43 | return 6; | ||
44 | } | ||
45 | |||
46 | QRESULT ClipboardAppletImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) | ||
47 | { | ||
48 | *iface = 0; | ||
49 | if ( uuid == IID_QUnknown ) | ||
50 | *iface = this; | ||
51 | else if ( uuid == IID_TaskbarApplet ) | ||
52 | *iface = this; | ||
53 | else | ||
54 | return QS_FALSE; | ||
55 | |||
56 | if ( *iface ) | ||
57 | (*iface)->addRef(); | ||
58 | return QS_OK; | ||
59 | } | ||
60 | |||
61 | Q_EXPORT_INTERFACE() | ||
62 | { | ||
63 | Q_CREATE_INSTANCE( ClipboardAppletImpl ) | ||
64 | } | ||
65 | |||
66 | |||
diff --git a/core/applets/clipboardapplet/clipboardappletimpl.h b/core/applets/clipboardapplet/clipboardappletimpl.h deleted file mode 100644 index 497360c..0000000 --- a/core/applets/clipboardapplet/clipboardappletimpl.h +++ b/dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #ifndef CLIPBOARDAPPLETIMPL_H | ||
21 | #define CLIPBOARDAPPLETIMPL_H | ||
22 | |||
23 | #include <qpe/taskbarappletinterface.h> | ||
24 | |||
25 | class ClipboardApplet; | ||
26 | |||
27 | class ClipboardAppletImpl : public TaskbarAppletInterface | ||
28 | { | ||
29 | public: | ||
30 | ClipboardAppletImpl(); | ||
31 | virtual ~ClipboardAppletImpl(); | ||
32 | |||
33 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); | ||
34 | Q_REFCOUNT | ||
35 | |||
36 | virtual QWidget *applet( QWidget *parent ); | ||
37 | virtual int position() const; | ||
38 | |||
39 | private: | ||
40 | ClipboardApplet *clipboard; | ||
41 | }; | ||
42 | |||
43 | #endif | ||