summaryrefslogtreecommitdiff
path: root/core/launcher/runningappbar.cpp
authormickeyl <mickeyl>2004-04-07 13:36:16 (UTC)
committer mickeyl <mickeyl>2004-04-07 13:36:16 (UTC)
commit4f1d28a25ce6180850c3d26bac9b638f0f25532b (patch) (side-by-side diff)
tree59b4879b1065086c9a2e28f16f7d48540c8a9456 /core/launcher/runningappbar.cpp
parent8af35b63a277ec14dcc4a0a6ca5bbe228e276b98 (diff)
downloadopie-4f1d28a25ce6180850c3d26bac9b638f0f25532b.zip
opie-4f1d28a25ce6180850c3d26bac9b638f0f25532b.tar.gz
opie-4f1d28a25ce6180850c3d26bac9b638f0f25532b.tar.bz2
use Opie debugging framework
Diffstat (limited to 'core/launcher/runningappbar.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/runningappbar.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/core/launcher/runningappbar.cpp b/core/launcher/runningappbar.cpp
index 2e9d2a9..a25963f 100644
--- a/core/launcher/runningappbar.cpp
+++ b/core/launcher/runningappbar.cpp
@@ -17,21 +17,25 @@
** not clear to you.
**
***********************************************************************/
#define QTOPIA_INTERNAL_PRELOADACCESS
+#include "runningappbar.h"
+#include "serverinterface.h"
-#include <stdlib.h>
+/* OPIE */
+#include <opie2/odebug.h>
+#include <qtopia/qcopenvelope_qws.h>
+using namespace Opie::Core;
+/* QT */
#include <qpainter.h>
-#include <qtopia/qcopenvelope_qws.h>
-
-#include "runningappbar.h"
-#include "serverinterface.h"
+/* STD */
+#include <stdlib.h>
RunningAppBar::RunningAppBar(QWidget* parent)
: QFrame(parent), selectedAppIndex(-1)
{
QCopChannel* channel = new QCopChannel( "QPE/System", this );
connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
@@ -48,37 +52,37 @@ void RunningAppBar::received(const QCString& msg, const QByteArray& data) {
// Since fast apps appear and disappear without disconnecting from their
// channel we need to watch for the showing/hiding events and update according.
QDataStream stream( data, IO_ReadOnly );
if ( msg == "fastAppShowing(QString)") {
QString appName;
stream >> appName;
- // qDebug("fastAppShowing %s", appName.data() );
+ // odebug << "fastAppShowing " << appName.data() << "" << oendl;
const AppLnk* f = ServerInterface::appLnks().findExec(appName);
if ( f ) addTask(*f);
} else if ( msg == "fastAppHiding(QString)") {
QString appName;
stream >> appName;
const AppLnk* f = ServerInterface::appLnks().findExec(appName);
if ( f ) removeTask(*f);
}
}
void RunningAppBar::addTask(const AppLnk& appLnk) {
- qDebug("Added %s to app list.", appLnk.name().latin1());
+ odebug << "Added " << appLnk.name() << " to app list." << oendl;
AppLnk* newApp = new AppLnk(appLnk);
newApp->setExec(appLnk.exec());
appList.prepend(newApp);
update();
}
void RunningAppBar::removeTask(const AppLnk& appLnk) {
unsigned int i = 0;
for (; i < appList.count() ; i++) {
AppLnk* target = appList.at(i);
if (target->exec() == appLnk.exec()) {
- qDebug("Removing %s from app list.", appLnk.name().latin1());
+ odebug << "Removing " << appLnk.name() << " from app list." << oendl;
appList.remove();
delete target;
}
}
update();
}
@@ -132,13 +136,13 @@ void RunningAppBar::paintEvent( QPaintEvent * )
QListIterator<AppLnk> it(appList);
for (; it.current(); i++, ++it ) {
if ( x + spacing <= width() ) {
curApp = it.current();
- qWarning("Drawing %s", curApp->name().latin1() );
+ owarn << "Drawing " << curApp->name() << "" << oendl;
if ( (int)i == selectedAppIndex )
p.fillRect( x, y, spacing, curApp->pixmap().height()+1, colorGroup().highlight() );
else
p.eraseRect( x, y, spacing, curApp->pixmap().height()+1 );
p.drawPixmap( x, y, curApp->pixmap() );
x += spacing;
@@ -150,13 +154,13 @@ QSize RunningAppBar::sizeHint() const
{
return QSize( frameWidth(), AppLnk::smallIconSize()+frameWidth()*2+3 );
}
void RunningAppBar::applicationLaunched(const QString &appName)
{
- qDebug("desktop:: app: %s launched with pid ", appName.data() );
+ odebug << "desktop:: app: " << appName.data() << " launched with pid " << oendl;
const AppLnk* newGuy = ServerInterface::appLnks().findExec(appName);
if ( newGuy && !newGuy->isPreloaded() ) {
addTask( *newGuy );
}
}