From a176c76090a3ba74f350d2066d6762c9b9a7eb3b Mon Sep 17 00:00:00 2001 From: jeremy Date: Fri, 15 Feb 2002 21:29:03 +0000 Subject: Added checking for an empty keyRegisterList for increased performance :) --- 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 @@ -188,13 +188,16 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e ) 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(); @@ -228,12 +231,7 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e ) 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; -- cgit v0.9.0.2