summaryrefslogtreecommitdiff
path: root/noncore/applets/memoryapplet
Unidiff
Diffstat (limited to 'noncore/applets/memoryapplet') (more/less context) (show whitespace changes)
-rw-r--r--noncore/applets/memoryapplet/memoryapplet.pro4
-rw-r--r--noncore/applets/memoryapplet/memoryappletimpl.cpp65
-rw-r--r--noncore/applets/memoryapplet/memoryappletimpl.h43
-rw-r--r--noncore/applets/memoryapplet/memorymeter.cpp14
-rw-r--r--noncore/applets/memoryapplet/memorymeter.h1
5 files changed, 13 insertions, 114 deletions
diff --git a/noncore/applets/memoryapplet/memoryapplet.pro b/noncore/applets/memoryapplet/memoryapplet.pro
index 6031386..3cd7839 100644
--- a/noncore/applets/memoryapplet/memoryapplet.pro
+++ b/noncore/applets/memoryapplet/memoryapplet.pro
@@ -3,14 +3,12 @@ CONFIG += qt plugin warn_on release
3HEADERS = ../../settings/sysinfo/graph.h \ 3HEADERS = ../../settings/sysinfo/graph.h \
4 ../../settings/sysinfo/load.h \ 4 ../../settings/sysinfo/load.h \
5 ../../settings/sysinfo/memory.h \ 5 ../../settings/sysinfo/memory.h \
6 memoryappletimpl.h \
7 memorymeter.h \ 6 memorymeter.h \
8 memorystatus.h \ 7 memorystatus.h \
9 swapfile.h 8 swapfile.h
10SOURCES = ../../settings/sysinfo/graph.cpp \ 9SOURCES = ../../settings/sysinfo/graph.cpp \
11 ../../settings/sysinfo/load.cpp \ 10 ../../settings/sysinfo/load.cpp \
12 ../../settings/sysinfo/memory.cpp \ 11 ../../settings/sysinfo/memory.cpp \
13 memoryappletimpl.cpp \
14 memorymeter.cpp \ 12 memorymeter.cpp \
15 memorystatus.cpp \ 13 memorystatus.cpp \
16 swapfile.cpp 14 swapfile.cpp
@@ -19,6 +17,6 @@ DESTDIR = $(OPIEDIR)/plugins/applets
19INCLUDEPATH += $(OPIEDIR)/include 17INCLUDEPATH += $(OPIEDIR)/include
20DEPENDPATH += ../$(OPIEDIR)/include 18DEPENDPATH += ../$(OPIEDIR)/include
21VERSION = 1.0.0 19VERSION = 1.0.0
22LIBS += -lqpe -lopieui2 20LIBS += -lqpe -lopiecore2 -lopieui2
23 21
24include ( $(OPIEDIR)/include.pro ) 22include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/applets/memoryapplet/memoryappletimpl.cpp b/noncore/applets/memoryapplet/memoryappletimpl.cpp
deleted file mode 100644
index a117e7f..0000000
--- a/noncore/applets/memoryapplet/memoryappletimpl.cpp
+++ b/dev/null
@@ -1,65 +0,0 @@
1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3**
4** This file is part of the 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 "memorymeter.h"
21#include "memoryappletimpl.h"
22
23MemoryAppletImpl::MemoryAppletImpl()
24 : memory(0)
25{
26}
27
28MemoryAppletImpl::~MemoryAppletImpl()
29{
30 delete memory;
31}
32
33QWidget *MemoryAppletImpl::applet( QWidget *parent )
34{
35 if ( !memory )
36 memory = new MemoryMeter( parent );
37
38 return memory;
39}
40
41int MemoryAppletImpl::position() const
42{
43 return 8;
44}
45
46QRESULT MemoryAppletImpl::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 (*iface)->addRef();
57
58 return QS_OK;
59}
60
61Q_EXPORT_INTERFACE()
62{
63 Q_CREATE_INSTANCE( MemoryAppletImpl )
64}
65
diff --git a/noncore/applets/memoryapplet/memoryappletimpl.h b/noncore/applets/memoryapplet/memoryappletimpl.h
deleted file mode 100644
index 2db7dbe..0000000
--- a/noncore/applets/memoryapplet/memoryappletimpl.h
+++ b/dev/null
@@ -1,43 +0,0 @@
1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3**
4** This file is part of the 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 MEMORYAPPLETIMPL_H
21#define MEMORYAPPLETIMPL_H
22
23#include <qtopia/taskbarappletinterface.h>
24
25class MemoryMeter;
26
27class /*QTOPIA_PLUGIN_EXPORT*/ MemoryAppletImpl : public TaskbarAppletInterface
28{
29public:
30 MemoryAppletImpl();
31 virtual ~MemoryAppletImpl();
32
33 QRESULT queryInterface( const QUuid&, QUnknownInterface** );
34 Q_REFCOUNT
35
36 virtual QWidget *applet( QWidget *parent );
37 virtual int position() const;
38
39private:
40 MemoryMeter *memory;
41};
42
43#endif
diff --git a/noncore/applets/memoryapplet/memorymeter.cpp b/noncore/applets/memoryapplet/memorymeter.cpp
index 54b5c52..9299f49 100644
--- a/noncore/applets/memoryapplet/memorymeter.cpp
+++ b/noncore/applets/memoryapplet/memorymeter.cpp
@@ -20,12 +20,10 @@
20#include "memorymeter.h" 20#include "memorymeter.h"
21#include "memorystatus.h" 21#include "memorystatus.h"
22 22
23#include <opie2/otaskbarapplet.h>
23#include <qtopia/power.h> 24#include <qtopia/power.h>
24#include <qtopia/config.h> 25#include <qtopia/config.h>
25
26#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
27#include <qtopia/qcopenvelope_qws.h> 26#include <qtopia/qcopenvelope_qws.h>
28#endif
29 27
30#include <qpainter.h> 28#include <qpainter.h>
31#include <qtimer.h> 29#include <qtimer.h>
@@ -66,6 +64,11 @@ MemoryMeter::~MemoryMeter()
66 delete (QWidget *) memoryView; 64 delete (QWidget *) memoryView;
67} 65}
68 66
67int MemoryMeter::position()
68{
69 return 7;
70}
71
69QSize MemoryMeter::sizeHint() const 72QSize MemoryMeter::sizeHint() const
70{ 73{
71 return QSize(10, AppLnk::smallIconSize()); 74 return QSize(10, AppLnk::smallIconSize());
@@ -237,3 +240,8 @@ void MemoryMeter::paintEvent( QPaintEvent* )
237 } 240 }
238} 241}
239 242
243Q_EXPORT_INTERFACE()
244{
245 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<MemoryMeter> );
246}
247
diff --git a/noncore/applets/memoryapplet/memorymeter.h b/noncore/applets/memoryapplet/memorymeter.h
index 0f3cb0b..ed541f0 100644
--- a/noncore/applets/memoryapplet/memorymeter.h
+++ b/noncore/applets/memoryapplet/memorymeter.h
@@ -31,6 +31,7 @@ class MemoryMeter : public QWidget
31public: 31public:
32 MemoryMeter( QWidget *parent = 0 ); 32 MemoryMeter( QWidget *parent = 0 );
33 ~MemoryMeter(); 33 ~MemoryMeter();
34 static int position();
34 35
35 QSize sizeHint() const; 36 QSize sizeHint() const;
36 MemoryStatus* memoryView; 37 MemoryStatus* memoryView;