-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 @@ -282,3 +282,2 @@ void ODevice::init ( ) b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib-> fheldservice ), ib-> fheldaction )); - d-> m_buttons. append ( b ); @@ -518,4 +517,5 @@ void ODevice::reloadButtonMapping ( ) } - + b. setPressedAction ( OQCopMessage ( pch, pm, pdata )); + b. setHeldAction ( OQCopMessage ( hch, hm, hdata )); @@ -526,7 +526,12 @@ 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 ( ); @@ -534,3 +539,3 @@ void ODevice::remapPressedAction ( int button, const OQCopMessage &action ) 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 ( )); @@ -548,3 +553,3 @@ void ODevice::remapHeldAction ( int button, const OQCopMessage &action ) ODeviceButton &b = d-> m_buttons [button]; - b. setHeldAction ( action ); + b. setHeldAction ( action ); diff --git a/libopie/odevicebutton.cpp b/libopie/odevicebutton.cpp index 2270343..4b22358 100644 --- a/libopie/odevicebutton.cpp +++ b/libopie/odevicebutton.cpp @@ -72,3 +72,3 @@ bool OQCopMessage::send ( ) { - if ( d-> m_channel. isEmpty ( ) || d-> m_message. isEmpty ( )) + if ( d-> m_channel. isEmpty ( ) || d-> m_message. isEmpty ( ) ) return false; @@ -220,2 +220,3 @@ void ODeviceButton::setFactoryPresetPressedAction(const OQCopMessage& action) + void ODeviceButton::setPressedAction(const OQCopMessage& action) |