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/clipboardapplet') 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 @@ -20,6 +20,7 @@ #include "clipboard.h" +#include #include #include @@ -60,6 +61,11 @@ ClipboardApplet::~ClipboardApplet ( ) { } +int ClipboardApplet::position() +{ + return 6; +} + void ClipboardApplet::shutdown ( ) { // the timer has to be stopped, or Qt/E will hang on quit() @@ -176,3 +182,8 @@ void ClipboardApplet::newData ( ) excllock = false; } + +Q_EXPORT_INTERFACE() +{ + Q_CREATE_INSTANCE( OTaskbarAppletWrapper ); +} 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 @@ -32,6 +32,7 @@ class ClipboardApplet : public QWidget public: ClipboardApplet ( QWidget *parent = 0, const char *name=0 ); ~ClipboardApplet ( ); + static int position(); protected: void mousePressEvent ( QMouseEvent *); 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 @@ -1,7 +1,7 @@ TEMPLATE = lib CONFIG += qt plugin warn_on release -HEADERS = clipboard.h clipboardappletimpl.h -SOURCES = clipboard.cpp clipboardappletimpl.cpp +HEADERS = clipboard.h +SOURCES = clipboard.cpp TARGET = clipboardapplet DESTDIR = $(OPIEDIR)/plugins/applets INCLUDEPATH += $(OPIEDIR)/include 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 @@ -/********************************************************************** -** 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 "clipboard.h" -#include "clipboardappletimpl.h" - - -ClipboardAppletImpl::ClipboardAppletImpl() - : clipboard(0) -{ -} - -ClipboardAppletImpl::~ClipboardAppletImpl() -{ - delete clipboard; -} - -QWidget *ClipboardAppletImpl::applet( QWidget *parent ) -{ - if ( !clipboard ) - clipboard = new ClipboardApplet( parent ); - return clipboard; -} - -int ClipboardAppletImpl::position() const -{ - return 6; -} - -QRESULT ClipboardAppletImpl::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( ClipboardAppletImpl ) -} - - 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 @@ -/********************************************************************** -** 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 CLIPBOARDAPPLETIMPL_H -#define CLIPBOARDAPPLETIMPL_H - -#include - -class ClipboardApplet; - -class ClipboardAppletImpl : public TaskbarAppletInterface -{ -public: - ClipboardAppletImpl(); - virtual ~ClipboardAppletImpl(); - - QRESULT queryInterface( const QUuid&, QUnknownInterface** ); - Q_REFCOUNT - - virtual QWidget *applet( QWidget *parent ); - virtual int position() const; - -private: - ClipboardApplet *clipboard; -}; - -#endif -- cgit v0.9.0.2