summaryrefslogtreecommitdiff
path: root/core/applets/irdaapplet
authormickeyl <mickeyl>2004-03-01 19:19:37 (UTC)
committer mickeyl <mickeyl>2004-03-01 19:19:37 (UTC)
commitddc3d749af5f7afebf69488b79641771fe246b5b (patch) (unidiff)
tree8ea8614906c568e4677493ef09040724d60dd2d4 /core/applets/irdaapplet
parentfb0981f47e529f9d1dd77fa005ffa3c3ecedff67 (diff)
downloadopie-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/irdaapplet') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/irdaapplet/irda.cpp17
-rw-r--r--core/applets/irdaapplet/irda.h1
-rw-r--r--core/applets/irdaapplet/irdaapplet.pro14
-rw-r--r--core/applets/irdaapplet/irdaappletimpl.cpp66
-rw-r--r--core/applets/irdaapplet/irdaappletimpl.h45
5 files changed, 23 insertions, 120 deletions
diff --git a/core/applets/irdaapplet/irda.cpp b/core/applets/irdaapplet/irda.cpp
index a47f33d..afc0592 100644
--- a/core/applets/irdaapplet/irda.cpp
+++ b/core/applets/irdaapplet/irda.cpp
@@ -16,3 +16,6 @@
16 16
17#include "irda.h"
17 18
19/* OPIE */
20#include <opie2/otaskbarapplet.h>
18#include <qpe/resource.h> 21#include <qpe/resource.h>
@@ -20,2 +23,3 @@
20 23
24/* QT */
21#include <qpainter.h> 25#include <qpainter.h>
@@ -25,2 +29,3 @@
25 29
30/* STD */
26#include <unistd.h> 31#include <unistd.h>
@@ -32,4 +37,2 @@
32 37
33#include "irda.h"
34
35//=========================================================================== 38//===========================================================================
@@ -62,2 +65,7 @@ IrdaApplet::IrdaApplet ( QWidget *parent, const char *name )
62 65
66int IrdaApplet::position()
67{
68 return 6;
69}
70
63void IrdaApplet::show() 71void IrdaApplet::show()
@@ -352 +360,6 @@ void IrdaApplet::slotMessage( const QCString& str, const QByteArray& ar ) {
352} 360}
361
362Q_EXPORT_INTERFACE()
363{
364 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<IrdaApplet> );
365}
diff --git a/core/applets/irdaapplet/irda.h b/core/applets/irdaapplet/irda.h
index ec1d32c..f713bbe 100644
--- a/core/applets/irdaapplet/irda.h
+++ b/core/applets/irdaapplet/irda.h
@@ -30,2 +30,3 @@ public:
30 ~IrdaApplet(); 30 ~IrdaApplet();
31 static int position();
31 32
diff --git a/core/applets/irdaapplet/irdaapplet.pro b/core/applets/irdaapplet/irdaapplet.pro
index 4e94dfb..31e8691 100644
--- a/core/applets/irdaapplet/irdaapplet.pro
+++ b/core/applets/irdaapplet/irdaapplet.pro
@@ -1,8 +1,8 @@
1TEMPLATE = lib 1 TEMPLATE = lib
2CONFIG += qt plugin warn_on release 2 CONFIG += qt plugin warn_on release
3HEADERS = irda.h irdaappletimpl.h 3 HEADERS = irda.h
4SOURCES = irda.cpp irdaappletimpl.cpp 4 SOURCES = irda.cpp
5TARGET = irdaapplet 5 TARGET = irdaapplet
6DESTDIR = $(OPIEDIR)/plugins/applets 6 DESTDIR = $(OPIEDIR)/plugins/applets
7INCLUDEPATH += $(OPIEDIR)/include 7 INCLUDEPATH+= $(OPIEDIR)/include
8DEPENDPATH += ../$(OPIEDIR)/include 8DEPENDPATH += ../$(OPIEDIR)/include
diff --git a/core/applets/irdaapplet/irdaappletimpl.cpp b/core/applets/irdaapplet/irdaappletimpl.cpp
deleted file mode 100644
index 33d98af..0000000
--- a/core/applets/irdaapplet/irdaappletimpl.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 "irda.h"
21#include "irdaappletimpl.h"
22
23
24IrdaAppletImpl::IrdaAppletImpl()
25 : irda(0)
26{
27}
28
29IrdaAppletImpl::~IrdaAppletImpl()
30{
31 delete irda;
32}
33
34QWidget *IrdaAppletImpl::applet( QWidget *parent )
35{
36 if ( !irda )
37 irda = new IrdaApplet( parent );
38 return irda;
39}
40
41int IrdaAppletImpl::position() const
42{
43 return 6;
44}
45
46QRESULT IrdaAppletImpl::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
61Q_EXPORT_INTERFACE()
62{
63 Q_CREATE_INSTANCE( IrdaAppletImpl )
64}
65
66
diff --git a/core/applets/irdaapplet/irdaappletimpl.h b/core/applets/irdaapplet/irdaappletimpl.h
deleted file mode 100644
index 024cc06..0000000
--- a/core/applets/irdaapplet/irdaappletimpl.h
+++ b/dev/null
@@ -1,45 +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 IRDAAPPLETIMPL_H
21#define IRDAAPPLETIMPL_H
22
23#include <qwidget.h>
24
25#include <qpe/taskbarappletinterface.h>
26
27class IrdaApplet;
28
29class IrdaAppletImpl : public TaskbarAppletInterface
30{
31public:
32 IrdaAppletImpl();
33 virtual ~IrdaAppletImpl();
34
35 QRESULT queryInterface( const QUuid&, QUnknownInterface** );
36 Q_REFCOUNT
37
38 virtual QWidget *applet( QWidget *parent );
39 virtual int position() const;
40
41private:
42 IrdaApplet *irda;
43};
44
45#endif