summaryrefslogtreecommitdiff
path: root/core/launcher/runningappbar.cpp
Unidiff
Diffstat (limited to 'core/launcher/runningappbar.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/runningappbar.cpp9
1 files changed, 0 insertions, 9 deletions
diff --git a/core/launcher/runningappbar.cpp b/core/launcher/runningappbar.cpp
index 3ac66f2..356200b 100644
--- a/core/launcher/runningappbar.cpp
+++ b/core/launcher/runningappbar.cpp
@@ -103,57 +103,48 @@ void RunningAppBar::received(const QCString& msg, const QByteArray& data)
103 QString appName; 103 QString appName;
104 stream >> appName; 104 stream >> appName;
105 removeTask(*m_AppLnkSet->findExec(appName)); 105 removeTask(*m_AppLnkSet->findExec(appName));
106 } 106 }
107} 107}
108 108
109void RunningAppBar::addTask(const AppLnk& appLnk) 109void RunningAppBar::addTask(const AppLnk& appLnk)
110{ 110{
111 // qDebug("Added %s to app list.", appLnk.name().latin1()); 111 // qDebug("Added %s to app list.", appLnk.name().latin1());
112 AppLnk* newApp = new AppLnk(appLnk); 112 AppLnk* newApp = new AppLnk(appLnk);
113 newApp->setExec(appLnk.exec()); 113 newApp->setExec(appLnk.exec());
114 m_AppList.prepend(newApp); 114 m_AppList.prepend(newApp);
115 update(); 115 update();
116} 116}
117 117
118void RunningAppBar::removeTask(const AppLnk& appLnk) 118void RunningAppBar::removeTask(const AppLnk& appLnk)
119{ 119{
120 unsigned int i = 0; 120 unsigned int i = 0;
121 for (; i < m_AppList.count() ; i++) { 121 for (; i < m_AppList.count() ; i++) {
122 AppLnk* target = m_AppList.at(i); 122 AppLnk* target = m_AppList.at(i);
123 if (target->exec() == appLnk.exec()) { 123 if (target->exec() == appLnk.exec()) {
124 qDebug("Removing %s from app list.", appLnk.name().latin1()); 124 qDebug("Removing %s from app list.", appLnk.name().latin1());
125 m_AppList.remove(); 125 m_AppList.remove();
126 126
127 // grab the keyboard back, in case the app crashed/forgot
128
129 QPEApplication *qpeapp = (QPEApplication *) qApp;
130
131 if ( appLnk.exec() == qpeapp-> keyboardGrabbedBy ( )) {
132 qDebug ( "grabbing keyboard back from %s", appLnk.name().latin1());
133 qpeapp-> grabKeyboard ( );
134 }
135
136 delete target; 127 delete target;
137 } 128 }
138 } 129 }
139 update(); 130 update();
140} 131}
141 132
142void RunningAppBar::mousePressEvent(QMouseEvent *e) 133void RunningAppBar::mousePressEvent(QMouseEvent *e)
143{ 134{
144 // Find out if the user is clicking on an app icon... 135 // Find out if the user is clicking on an app icon...
145 // If so, snag the index so when we repaint we show it 136 // If so, snag the index so when we repaint we show it
146 // as highlighed. 137 // as highlighed.
147 m_SelectedAppIndex = 0; 138 m_SelectedAppIndex = 0;
148 int x = 0; 139 int x = 0;
149 QListIterator<AppLnk> it( m_AppList ); 140 QListIterator<AppLnk> it( m_AppList );
150 for ( ; it.current(); ++it, ++m_SelectedAppIndex, x += spacing ) { 141 for ( ; it.current(); ++it, ++m_SelectedAppIndex, x += spacing ) {
151 if ( x + spacing <= width() ) { 142 if ( x + spacing <= width() ) {
152 if ( e->x() >= x && e->x() < x + spacing ) { 143 if ( e->x() >= x && e->x() < x + spacing ) {
153 if ( m_SelectedAppIndex < (int)m_AppList.count() ) { 144 if ( m_SelectedAppIndex < (int)m_AppList.count() ) {
154 repaint(FALSE); 145 repaint(FALSE);
155 return ; 146 return ;
156 } 147 }
157 } 148 }
158 } 149 }
159 else { 150 else {