From ddc3d749af5f7afebf69488b79641771fe246b5b Mon Sep 17 00:00:00 2001 From: mickeyl Date: Mon, 01 Mar 2004 19:19:37 +0000 Subject: remove duplicated boiler plate code in favour of the OTaskbarApplet template --- (limited to 'core/applets/irdaapplet') 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 @@ -14,15 +14,20 @@ ** **********************************************************************/ +#include "irda.h" +/* OPIE */ +#include #include #include +/* QT */ #include #include #include #include +/* STD */ #include #include #include @@ -30,8 +35,6 @@ #include #include -#include "irda.h" - //=========================================================================== IrdaApplet::IrdaApplet ( QWidget *parent, const char *name ) @@ -60,6 +63,11 @@ IrdaApplet::IrdaApplet ( QWidget *parent, const char *name ) this, SLOT(slotMessage(const QCString&, const QByteArray& ) ) ); } +int IrdaApplet::position() +{ + return 6; +} + void IrdaApplet::show() { QWidget::show ( ); @@ -350,3 +358,8 @@ void IrdaApplet::slotMessage( const QCString& str, const QByteArray& ar ) { e << list; } } + +Q_EXPORT_INTERFACE() +{ + Q_CREATE_INSTANCE( OTaskbarAppletWrapper ); +} 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 @@ -28,6 +28,7 @@ class IrdaApplet : public QWidget public: IrdaApplet( QWidget *parent = 0, const char *name = 0 ); ~IrdaApplet(); + static int position(); virtual void show ( ); 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,10 +1,10 @@ -TEMPLATE = lib -CONFIG += qt plugin warn_on release -HEADERS = irda.h irdaappletimpl.h -SOURCES = irda.cpp irdaappletimpl.cpp -TARGET = irdaapplet -DESTDIR = $(OPIEDIR)/plugins/applets -INCLUDEPATH += $(OPIEDIR)/include +TEMPLATE = lib +CONFIG += qt plugin warn_on release +HEADERS = irda.h +SOURCES = irda.cpp +TARGET = irdaapplet +DESTDIR = $(OPIEDIR)/plugins/applets +INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += ../$(OPIEDIR)/include LIBS += -lqpe VERSION = 1.0.0 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 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** This file is part of Qtopia Environment. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ -#include "irda.h" -#include "irdaappletimpl.h" - - -IrdaAppletImpl::IrdaAppletImpl() - : irda(0) -{ -} - -IrdaAppletImpl::~IrdaAppletImpl() -{ - delete irda; -} - -QWidget *IrdaAppletImpl::applet( QWidget *parent ) -{ - if ( !irda ) - irda = new IrdaApplet( parent ); - return irda; -} - -int IrdaAppletImpl::position() const -{ - return 6; -} - -QRESULT IrdaAppletImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) -{ - *iface = 0; - if ( uuid == IID_QUnknown ) - *iface = this; - else if ( uuid == IID_TaskbarApplet ) - *iface = this; - else - return QS_FALSE; - - if ( *iface ) - (*iface)->addRef(); - return QS_OK; -} - -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( IrdaAppletImpl ) -} - - 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 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** This file is part of Qtopia Environment. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ -#ifndef IRDAAPPLETIMPL_H -#define IRDAAPPLETIMPL_H - -#include - -#include - -class IrdaApplet; - -class IrdaAppletImpl : public TaskbarAppletInterface -{ -public: - IrdaAppletImpl(); - virtual ~IrdaAppletImpl(); - - QRESULT queryInterface( const QUuid&, QUnknownInterface** ); - Q_REFCOUNT - - virtual QWidget *applet( QWidget *parent ); - virtual int position() const; - -private: - IrdaApplet *irda; -}; - -#endif -- cgit v0.9.0.2