Diffstat (limited to 'core/launcher/runningappbar.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/runningappbar.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/launcher/runningappbar.cpp b/core/launcher/runningappbar.cpp index 11d10dc..2e9d2a9 100644 --- a/core/launcher/runningappbar.cpp +++ b/core/launcher/runningappbar.cpp | |||
@@ -1,86 +1,86 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 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 | 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 | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 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. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | ***********************************************************************/ | 19 | ***********************************************************************/ |
20 | 20 | ||
21 | #define QTOPIA_INTERNAL_PRELOADACCESS | 21 | #define QTOPIA_INTERNAL_PRELOADACCESS |
22 | 22 | ||
23 | 23 | ||
24 | #include <stdlib.h> | 24 | #include <stdlib.h> |
25 | 25 | ||
26 | #include <qpainter.h> | 26 | #include <qpainter.h> |
27 | 27 | ||
28 | #include <qtopia/qcopenvelope_qws.h> | 28 | #include <qtopia/qcopenvelope_qws.h> |
29 | 29 | ||
30 | #include "runningappbar.h" | 30 | #include "runningappbar.h" |
31 | #include "serverinterface.h" | 31 | #include "serverinterface.h" |
32 | 32 | ||
33 | RunningAppBar::RunningAppBar(QWidget* parent) | 33 | RunningAppBar::RunningAppBar(QWidget* parent) |
34 | : QFrame(parent), selectedAppIndex(-1) | 34 | : QFrame(parent), selectedAppIndex(-1) |
35 | { | 35 | { |
36 | QCopChannel* channel = new QCopChannel( "QPE/System", this ); | 36 | QCopChannel* channel = new QCopChannel( "QPE/System", this ); |
37 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | 37 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), |
38 | this, SLOT(received(const QCString&, const QByteArray&)) ); | 38 | this, SLOT(received(const QCString&,const QByteArray&)) ); |
39 | 39 | ||
40 | spacing = AppLnk::smallIconSize()+3; | 40 | spacing = AppLnk::smallIconSize()+3; |
41 | } | 41 | } |
42 | 42 | ||
43 | RunningAppBar::~RunningAppBar() | 43 | RunningAppBar::~RunningAppBar() |
44 | { | 44 | { |
45 | } | 45 | } |
46 | 46 | ||
47 | void RunningAppBar::received(const QCString& msg, const QByteArray& data) { | 47 | void RunningAppBar::received(const QCString& msg, const QByteArray& data) { |
48 | // Since fast apps appear and disappear without disconnecting from their | 48 | // Since fast apps appear and disappear without disconnecting from their |
49 | // channel we need to watch for the showing/hiding events and update according. | 49 | // channel we need to watch for the showing/hiding events and update according. |
50 | QDataStream stream( data, IO_ReadOnly ); | 50 | QDataStream stream( data, IO_ReadOnly ); |
51 | if ( msg == "fastAppShowing(QString)") { | 51 | if ( msg == "fastAppShowing(QString)") { |
52 | QString appName; | 52 | QString appName; |
53 | stream >> appName; | 53 | stream >> appName; |
54 | // qDebug("fastAppShowing %s", appName.data() ); | 54 | // qDebug("fastAppShowing %s", appName.data() ); |
55 | const AppLnk* f = ServerInterface::appLnks().findExec(appName); | 55 | const AppLnk* f = ServerInterface::appLnks().findExec(appName); |
56 | if ( f ) addTask(*f); | 56 | if ( f ) addTask(*f); |
57 | } else if ( msg == "fastAppHiding(QString)") { | 57 | } else if ( msg == "fastAppHiding(QString)") { |
58 | QString appName; | 58 | QString appName; |
59 | stream >> appName; | 59 | stream >> appName; |
60 | const AppLnk* f = ServerInterface::appLnks().findExec(appName); | 60 | const AppLnk* f = ServerInterface::appLnks().findExec(appName); |
61 | if ( f ) removeTask(*f); | 61 | if ( f ) removeTask(*f); |
62 | } | 62 | } |
63 | } | 63 | } |
64 | 64 | ||
65 | void RunningAppBar::addTask(const AppLnk& appLnk) { | 65 | void RunningAppBar::addTask(const AppLnk& appLnk) { |
66 | qDebug("Added %s to app list.", appLnk.name().latin1()); | 66 | qDebug("Added %s to app list.", appLnk.name().latin1()); |
67 | AppLnk* newApp = new AppLnk(appLnk); | 67 | AppLnk* newApp = new AppLnk(appLnk); |
68 | newApp->setExec(appLnk.exec()); | 68 | newApp->setExec(appLnk.exec()); |
69 | appList.prepend(newApp); | 69 | appList.prepend(newApp); |
70 | update(); | 70 | update(); |
71 | } | 71 | } |
72 | 72 | ||
73 | void RunningAppBar::removeTask(const AppLnk& appLnk) { | 73 | void RunningAppBar::removeTask(const AppLnk& appLnk) { |
74 | unsigned int i = 0; | 74 | unsigned int i = 0; |
75 | for (; i < appList.count() ; i++) { | 75 | for (; i < appList.count() ; i++) { |
76 | AppLnk* target = appList.at(i); | 76 | AppLnk* target = appList.at(i); |
77 | if (target->exec() == appLnk.exec()) { | 77 | if (target->exec() == appLnk.exec()) { |
78 | qDebug("Removing %s from app list.", appLnk.name().latin1()); | 78 | qDebug("Removing %s from app list.", appLnk.name().latin1()); |
79 | appList.remove(); | 79 | appList.remove(); |
80 | delete target; | 80 | delete target; |
81 | } | 81 | } |
82 | } | 82 | } |
83 | update(); | 83 | update(); |
84 | } | 84 | } |
85 | 85 | ||
86 | void RunningAppBar::mousePressEvent(QMouseEvent *e) | 86 | void RunningAppBar::mousePressEvent(QMouseEvent *e) |