summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index ce99bad..a00fae2 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -167,94 +167,92 @@ void DesktopApplication::receive( const QCString &msg, const QByteArray &data )
QString c, m;
stream >> k;
stream >> c;
stream >> m;
qWarning("KeyRegisterRecieved: %i, %s, %s", k, (const char*)c, (const char *)m);
keyRegisterList.append(QCopKeyRegister(k,c,m));
}
}
enum MemState { Unknown, VeryLow, Low, Normal } memstate=Unknown;
#ifdef Q_WS_QWS
bool DesktopApplication::qwsEventFilter( QWSEvent *e )
{
qpedesktop->checkMemory();
if ( e->type == QWSEvent::Key ) {
QWSKeyEvent *ke = (QWSKeyEvent *)e;
if ( !loggedin && ke->simpleData.keycode != Key_F34 )
return TRUE;
bool press = ke->simpleData.is_press;
- KeyRegisterList::Iterator it;
- for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it )
+ if (!keyRegisterList.isEmpty())
{
- if ((*it).getKeyCode() == ke->simpleData.keycode)
- QCopEnvelope((*it).getChannel().utf8(), (*it).getMessage().utf8());
+ KeyRegisterList::Iterator it;
+ for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it )
+ {
+ if ((*it).getKeyCode() == ke->simpleData.keycode)
+ QCopEnvelope((*it).getChannel().utf8(), (*it).getMessage().utf8());
+ }
}
-
+
if ( !keyboardGrabbed() ) {
if ( ke->simpleData.keycode == Key_F9 ) {
if ( press ) emit datebook();
return TRUE;
}
if ( ke->simpleData.keycode == Key_F10 ) {
if ( !press && cardSendTimer ) {
emit contacts();
delete cardSendTimer;
} else if ( press ) {
cardSendTimer = new QTimer();
cardSendTimer->start( 2000, TRUE );
connect( cardSendTimer, SIGNAL( timeout() ), this, SLOT( sendCard() ) );
}
return TRUE;
}
/* menu key now opens application menu/toolbar
if ( ke->simpleData.keycode == Key_F11 ) {
if ( press ) emit menu();
return TRUE;
}
*/
if ( ke->simpleData.keycode == Key_F12 ) {
while( activePopupWidget() )
activePopupWidget()->close();
if ( press ) emit launch();
return TRUE;
}
if ( ke->simpleData.keycode == Key_F13 ) {
if ( press ) emit email();
return TRUE;
}
}
- /*
- if ( ke->simpleData.keycode == 4096 ) {
- QCopEnvelope e("QPE/VMemo", "toggleRecord()");
- return TRUE;
- }
- */
+
if ( ke->simpleData.keycode == Key_F34 ) {
if ( press ) emit power();
return TRUE;
}
if ( ke->simpleData.keycode == Key_F35 ) {
if ( press ) emit backlight();
return TRUE;
}
if ( ke->simpleData.keycode == Key_F32 ) {
if ( press ) QCopEnvelope e( "QPE/Desktop", "startSync()" );
return TRUE;
}
if ( ke->simpleData.keycode == Key_F31 && !ke->simpleData.modifiers ) {
if ( press ) emit symbol();
return TRUE;
}
if ( ke->simpleData.keycode == Key_NumLock ) {
if ( press ) emit numLockStateToggle();
}
if ( ke->simpleData.keycode == Key_CapsLock ) {
if ( press ) emit capsLockStateToggle();
}
if ( press )
qpedesktop->keyClick();