author | groucho <groucho> | 2003-03-19 11:36:34 (UTC) |
---|---|---|
committer | groucho <groucho> | 2003-03-19 11:36:34 (UTC) |
commit | 28be0fcc9bda71175c3ee17e79fce2ac24340ff2 (patch) (side-by-side diff) | |
tree | f09c80460e4f0219eb308d612a2e67df57f2c254 /libopie | |
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-- | libopie/odevice.cpp | 15 | ||||
-rw-r--r-- | libopie/odevicebutton.cpp | 3 |
2 files changed, 12 insertions, 6 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index 9e97c56..d5e3c5c 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp @@ -281,5 +281,4 @@ void ODevice::init ( ) b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib-> fpressedservice ), ib-> fpressedaction )); b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib-> fheldservice ), ib-> fheldaction )); - d-> m_buttons. append ( b ); } @@ -517,6 +516,7 @@ void ODevice::reloadButtonMapping ( ) // hdata = decodeBase64 ( buttonFile. readEntry ( "HeldActionArgs" )); } - + b. setPressedAction ( OQCopMessage ( pch, pm, pdata )); + b. setHeldAction ( OQCopMessage ( hch, hm, hdata )); } @@ -525,13 +525,18 @@ void ODevice::reloadButtonMapping ( ) void ODevice::remapPressedAction ( int button, const OQCopMessage &action ) { + QString mb_chan; + if ( button >= (int) d-> m_buttons. count ( )) return; + ODeviceButton &b = d-> m_buttons [button]; - b. setPressedAction ( action ); + b. setPressedAction ( action ); + + mb_chan=b. pressedAction ( ). channel ( ); Config buttonFile ( "ButtonSettings" ); buttonFile. setGroup ( "Button" + QString::number ( button )); - buttonFile. writeEntry ( "PressedActionChannel", (const char*) b. pressedAction ( ). channel ( )); + buttonFile. writeEntry ( "PressedActionChannel", (const char*) mb_chan); buttonFile. writeEntry ( "PressedActionMessage", (const char*) b. pressedAction ( ). message ( )); @@ -547,5 +552,5 @@ void ODevice::remapHeldAction ( int button, const OQCopMessage &action ) ODeviceButton &b = d-> m_buttons [button]; - b. setHeldAction ( action ); + b. setHeldAction ( action ); Config buttonFile ( "ButtonSettings" ); diff --git a/libopie/odevicebutton.cpp b/libopie/odevicebutton.cpp index 2270343..4b22358 100644 --- a/libopie/odevicebutton.cpp +++ b/libopie/odevicebutton.cpp @@ -71,5 +71,5 @@ void OQCopMessage::init ( const QCString &ch, const QCString &m, const QByteArra bool OQCopMessage::send ( ) { - if ( d-> m_channel. isEmpty ( ) || d-> m_message. isEmpty ( )) + if ( d-> m_channel. isEmpty ( ) || d-> m_message. isEmpty ( ) ) return false; @@ -219,4 +219,5 @@ void ODeviceButton::setFactoryPresetPressedAction(const OQCopMessage& action) } + void ODeviceButton::setPressedAction(const OQCopMessage& action) { |