author | groucho <groucho> | 2003-03-19 11:36:34 (UTC) |
---|---|---|
committer | groucho <groucho> | 2003-03-19 11:36:34 (UTC) |
commit | 28be0fcc9bda71175c3ee17e79fce2ac24340ff2 (patch) (unidiff) | |
tree | f09c80460e4f0219eb308d612a2e67df57f2c254 /core/launcher/desktop.cpp | |
parent | 18c6c51705de3b1897f671e54b25929e74d11f23 (diff) | |
download | opie-28be0fcc9bda71175c3ee17e79fce2ac24340ff2.zip opie-28be0fcc9bda71175c3ee17e79fce2ac24340ff2.tar.gz opie-28be0fcc9bda71175c3ee17e79fce2ac24340ff2.tar.bz2 |
Fixed bug #744 where non mapped buttons in buttonsettings were not saved by introducing the "
ignore" statement.
Also removed unsed debug code
-rw-r--r-- | core/launcher/desktop.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index 59f2aea..fbcce7c 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp | |||
@@ -342,25 +342,35 @@ void DesktopApplication::sendHeldAction ( ) | |||
342 | 342 | ||
343 | 343 | ||
344 | 344 | ||
345 | void DesktopApplication::checkButtonAction ( const ODeviceButton *db, int /*keycode*/, bool press, bool autoRepeat ) | 345 | bool DesktopApplication::checkButtonAction ( const ODeviceButton *db, int /*keycode*/, bool press, bool autoRepeat ) |
346 | { | 346 | { |
347 | if ( db ) { | 347 | if ( db ) { |
348 | if ( !press && !autoRepeat && m_button_timer-> isActive ( )) { | 348 | if ( !press && !autoRepeat && m_button_timer-> isActive ( )) { |
349 | m_button_timer-> stop ( ); | 349 | m_button_timer-> stop ( ); |
350 | if ( !db-> pressedAction ( ). channel ( ). isEmpty ( )) { | 350 | |
351 | if (!db-> pressedAction ( ). channel ( ) .isEmpty()) | ||
352 | { | ||
353 | if ( db-> pressedAction ( ). channel ( )!="ignore") { | ||
351 | db-> pressedAction ( ). send ( ); | 354 | db-> pressedAction ( ). send ( ); |
352 | } | 355 | } |
356 | else return false; | ||
357 | } | ||
353 | } | 358 | } |
354 | else if ( press && !autoRepeat ) { | 359 | else if ( press && !autoRepeat ) { |
355 | m_button_timer-> stop ( ); | 360 | m_button_timer-> stop ( ); |
361 | if (!db-> pressedAction ( ). channel ( ) .isEmpty()) | ||
362 | { | ||
356 | 363 | ||
357 | if ( !db-> heldAction ( ). channel ( ). isEmpty ( )) { | 364 | if ( db-> heldAction ( ). channel ( )!="ignore") { |
358 | m_last_button = db; | 365 | m_last_button = db; |
359 | m_button_timer-> start ( ODevice::inst ( )-> buttonHoldTime ( ), true ); | 366 | m_button_timer-> start ( ODevice::inst ( )-> buttonHoldTime ( ), true ); |
360 | } | 367 | } |
368 | else return false; | ||
361 | } | 369 | } |
362 | } | 370 | } |
363 | } | 371 | } |
372 | return true; | ||
373 | } | ||
364 | 374 | ||
365 | bool DesktopApplication::eventFilter ( QObject *o, QEvent *e ) | 375 | bool DesktopApplication::eventFilter ( QObject *o, QEvent *e ) |
366 | { | 376 | { |
@@ -370,8 +380,7 @@ bool DesktopApplication::eventFilter ( QObject *o, QEvent *e ) | |||
370 | const ODeviceButton *db = ODevice::inst ( )-> buttonForKeycode ( ke-> key ( )); | 380 | const ODeviceButton *db = ODevice::inst ( )-> buttonForKeycode ( ke-> key ( )); |
371 | 381 | ||
372 | if ( db ) { | 382 | if ( db ) { |
373 | checkButtonAction ( db, ke-> key ( ), e-> type ( ) == QEvent::KeyPress, ke-> isAutoRepeat ( )); | 383 | return checkButtonAction ( db, ke-> key ( ), e-> type ( ) == QEvent::KeyPress, ke-> isAutoRepeat ( )); |
374 | return true; | ||
375 | } | 384 | } |
376 | } | 385 | } |
377 | return QPEApplication::eventFilter ( o, e ); | 386 | return QPEApplication::eventFilter ( o, e ); |