author | jeremy <jeremy> | 2002-02-15 21:29:03 (UTC) |
---|---|---|
committer | jeremy <jeremy> | 2002-02-15 21:29:03 (UTC) |
commit | a176c76090a3ba74f350d2066d6762c9b9a7eb3b (patch) (unidiff) | |
tree | b2dd448bd0fa8bd3d1e1730b44427f5c2f5f052f | |
parent | b0768575b7bc1e4fe477d37a49cccc7e3d92bf85 (diff) | |
download | opie-a176c76090a3ba74f350d2066d6762c9b9a7eb3b.zip opie-a176c76090a3ba74f350d2066d6762c9b9a7eb3b.tar.gz opie-a176c76090a3ba74f350d2066d6762c9b9a7eb3b.tar.bz2 |
Added checking for an empty keyRegisterList for increased performance :)
-rw-r--r-- | core/launcher/desktop.cpp | 20 |
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 | |||
@@ -185,19 +185,22 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e ) | |||
185 | if ( e->type == QWSEvent::Key ) { | 185 | if ( e->type == QWSEvent::Key ) { |
186 | QWSKeyEvent *ke = (QWSKeyEvent *)e; | 186 | QWSKeyEvent *ke = (QWSKeyEvent *)e; |
187 | if ( !loggedin && ke->simpleData.keycode != Key_F34 ) | 187 | if ( !loggedin && ke->simpleData.keycode != Key_F34 ) |
188 | return TRUE; | 188 | return TRUE; |
189 | bool press = ke->simpleData.is_press; | 189 | bool press = ke->simpleData.is_press; |
190 | 190 | ||
191 | KeyRegisterList::Iterator it; | 191 | if (!keyRegisterList.isEmpty()) |
192 | for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) | ||
193 | { | 192 | { |
194 | if ((*it).getKeyCode() == ke->simpleData.keycode) | 193 | KeyRegisterList::Iterator it; |
195 | QCopEnvelope((*it).getChannel().utf8(), (*it).getMessage().utf8()); | 194 | for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) |
195 | { | ||
196 | if ((*it).getKeyCode() == ke->simpleData.keycode) | ||
197 | QCopEnvelope((*it).getChannel().utf8(), (*it).getMessage().utf8()); | ||
198 | } | ||
196 | } | 199 | } |
197 | 200 | ||
198 | if ( !keyboardGrabbed() ) { | 201 | if ( !keyboardGrabbed() ) { |
199 | if ( ke->simpleData.keycode == Key_F9 ) { | 202 | if ( ke->simpleData.keycode == Key_F9 ) { |
200 | if ( press ) emit datebook(); | 203 | if ( press ) emit datebook(); |
201 | return TRUE; | 204 | return TRUE; |
202 | } | 205 | } |
203 | if ( ke->simpleData.keycode == Key_F10 ) { | 206 | if ( ke->simpleData.keycode == Key_F10 ) { |
@@ -225,18 +228,13 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e ) | |||
225 | } | 228 | } |
226 | if ( ke->simpleData.keycode == Key_F13 ) { | 229 | if ( ke->simpleData.keycode == Key_F13 ) { |
227 | if ( press ) emit email(); | 230 | if ( press ) emit email(); |
228 | return TRUE; | 231 | return TRUE; |
229 | } | 232 | } |
230 | } | 233 | } |
231 | /* | 234 | |
232 | if ( ke->simpleData.keycode == 4096 ) { | ||
233 | QCopEnvelope e("QPE/VMemo", "toggleRecord()"); | ||
234 | return TRUE; | ||
235 | } | ||
236 | */ | ||
237 | if ( ke->simpleData.keycode == Key_F34 ) { | 235 | if ( ke->simpleData.keycode == Key_F34 ) { |
238 | if ( press ) emit power(); | 236 | if ( press ) emit power(); |
239 | return TRUE; | 237 | return TRUE; |
240 | } | 238 | } |
241 | if ( ke->simpleData.keycode == Key_F35 ) { | 239 | if ( ke->simpleData.keycode == Key_F35 ) { |
242 | if ( press ) emit backlight(); | 240 | if ( press ) emit backlight(); |