summaryrefslogtreecommitdiff
path: root/noncore/applets/memoryapplet/memorymeter.cpp
Side-by-side diff
Diffstat (limited to 'noncore/applets/memoryapplet/memorymeter.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/applets/memoryapplet/memorymeter.cpp14
1 files changed, 11 insertions, 3 deletions
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
@@ -11,30 +11,28 @@
** 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 "memorymeter.h"
#include "memorystatus.h"
+#include <opie2/otaskbarapplet.h>
#include <qtopia/power.h>
#include <qtopia/config.h>
-
-#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
#include <qtopia/qcopenvelope_qws.h>
-#endif
#include <qpainter.h>
#include <qtimer.h>
#include <qapplication.h>
#include <qtopia/applnk.h>
MemoryMeter::MemoryMeter( QWidget *parent )
: QWidget( parent ), memoryView(0)
{
bvsz = QSize();
if ( qApp->desktop()->height() >= 300 )
@@ -57,24 +55,29 @@ MemoryMeter::MemoryMeter( QWidget *parent )
setFixedWidth(10);
setFixedHeight(AppLnk::smallIconSize());
usageTimer = new QTimer( this );
connect( usageTimer, SIGNAL(timeout()), this, SLOT(usageTimeout()) );
timerEvent(0);
}
MemoryMeter::~MemoryMeter()
{
delete (QWidget *) memoryView;
}
+int MemoryMeter::position()
+{
+ return 7;
+}
+
QSize MemoryMeter::sizeHint() const
{
return QSize(10, AppLnk::smallIconSize());
}
bool MemoryMeter::updateMemoryViewGeometry()
{
if (memoryView != 0)
{
QSize sz = memoryView->sizeHint();
if ( sz != bvsz )
{
@@ -228,12 +231,17 @@ void MemoryMeter::paintEvent( QPaintEvent* )
p.setBrush(c);
p.drawRect(batt_xoffset, unused_offset, band_width, unused_height);
p.drawRect(batt_xoffset + 2 * band_width, unused_offset, band_width, unused_height);
p.setBrush(lightc);
p.drawRect(batt_xoffset + band_width, unused_offset, band_width, unused_height);
p.setBrush(darkc);
p.drawRect(batt_xoffset + 3 * band_width, unused_offset, band_width, unused_height);
}
}
+Q_EXPORT_INTERFACE()
+{
+ Q_CREATE_INSTANCE( OTaskbarAppletWrapper<MemoryMeter> );
+}
+