summaryrefslogtreecommitdiff
path: root/libopie/odevice.cpp
Side-by-side diff
Diffstat (limited to 'libopie/odevice.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevice.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp
index 9e97c56..d5e3c5c 100644
--- a/libopie/odevice.cpp
+++ b/libopie/odevice.cpp
@@ -277,13 +277,12 @@ void ODevice::init ( )
if (( ib-> model & Model_iPAQ_H36xx ) == Model_iPAQ_H36xx ) {
b. setKeycode ( ib-> code );
b. setUserText ( qApp-> translate ( "Button", ib-> utext ));
b. setPixmap ( Resource::loadPixmap ( ib-> pix ));
b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib-> fpressedservice ), ib-> fpressedaction ));
b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib-> fheldservice ), ib-> fheldaction ));
-
d-> m_buttons. append ( b );
}
}
reloadButtonMapping ( );
}
@@ -513,29 +512,35 @@ void ODevice::reloadButtonMapping ( )
// pdata = decodeBase64 ( buttonFile. readEntry ( "PressedActionArgs" ));
hch = cfg. readEntry ( "HeldActionChannel" ). latin1 ( );
hm = cfg. readEntry ( "HeldActionMessage" ). latin1 ( );
// hdata = decodeBase64 ( buttonFile. readEntry ( "HeldActionArgs" ));
}
-
+
b. setPressedAction ( OQCopMessage ( pch, pm, pdata ));
+
b. setHeldAction ( OQCopMessage ( hch, hm, hdata ));
}
}
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 ( ));
// buttonFile. writeEntry ( "PressedActionArgs", encodeBase64 ( b. pressedAction ( ). data ( )));
QCopEnvelope ( "QPE/System", "deviceButtonMappingChanged()" );
}
@@ -543,13 +548,13 @@ void ODevice::remapPressedAction ( int button, const OQCopMessage &action )
void ODevice::remapHeldAction ( int button, const OQCopMessage &action )
{
if ( button >= (int) d-> m_buttons. count ( ))
return;
ODeviceButton &b = d-> m_buttons [button];
- b. setHeldAction ( action );
+ b. setHeldAction ( action );
Config buttonFile ( "ButtonSettings" );
buttonFile. setGroup ( "Button" + QString::number ( button ));
buttonFile. writeEntry ( "HeldActionChannel", (const char *) b. heldAction ( ). channel ( ));
buttonFile. writeEntry ( "HeldActionMessage", (const char *) b. heldAction ( ). message ( ));