summaryrefslogtreecommitdiff
authorzecke <zecke>2004-11-03 23:04:36 (UTC)
committer zecke <zecke>2004-11-03 23:04:36 (UTC)
commitcd2d50799e087fad5b56df9d7fe9aa572a313e64 (patch) (unidiff)
tree561df7f2fc260c9b4d3c8d9055698201e47939d3
parenta6adcd3869b9c9c7548290ea686bc4e78ed62fc3 (diff)
downloadopie-cd2d50799e087fad5b56df9d7fe9aa572a313e64.zip
opie-cd2d50799e087fad5b56df9d7fe9aa572a313e64.tar.gz
opie-cd2d50799e087fad5b56df9d7fe9aa572a313e64.tar.bz2
-SIMpad crashes on QObject::connect() of the QCopChannel
-Luckily (I'm a cheater) OApplication can emit the signal for us -Event more lucky, qpe and every quicklaunchable application has a OApplication instance... so the signal is almost available everywhere -do not call initButtons from reloadButtonMappings if d->m_buttons exists
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index 67cae1c..e57cdef 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -623,53 +623,53 @@ uint ODevice::buttonHoldTime() const
623{ 623{
624 return d->m_holdtime; 624 return d->m_holdtime;
625} 625}
626 626
627/** 627/**
628* This method return a ODeviceButton for a key code 628* This method return a ODeviceButton for a key code
629* or 0 if no special hardware button is available for the device 629* or 0 if no special hardware button is available for the device
630* 630*
631* @return The devicebutton or 0l 631* @return The devicebutton or 0l
632* @see ODeviceButton 632* @see ODeviceButton
633*/ 633*/
634const ODeviceButton *ODevice::buttonForKeycode ( ushort code ) 634const ODeviceButton *ODevice::buttonForKeycode ( ushort code )
635{ 635{
636 initButtons(); 636 initButtons();
637 637
638 for ( QValueListConstIterator<ODeviceButton> it = d->m_buttons->begin(); it != d->m_buttons->end(); ++it ) { 638 for ( QValueListConstIterator<ODeviceButton> it = d->m_buttons->begin(); it != d->m_buttons->end(); ++it ) {
639 if ( (*it). keycode() == code ) 639 if ( (*it). keycode() == code )
640 return &(*it); 640 return &(*it);
641 } 641 }
642 return 0; 642 return 0;
643} 643}
644 644
645void ODevice::reloadButtonMapping() 645void ODevice::reloadButtonMapping()
646{ 646{
647 if(!d->m_buttons)
647 initButtons(); 648 initButtons();
648 649
649 if(!d->m_initializedButtonQcop) { 650 if(!d->m_initializedButtonQcop) {
650 QCopChannel *chan = new QCopChannel("QPE/System", this, "ODevice button channel"); 651 connect(qApp,SIGNAL(systemMessageSignal(const QCString&,const QByteArray&)),
651 connect(chan,SIGNAL(received(const QCString&,const QByteArray&)),
652 this,SLOT(systemMessage(const QCString&,const QByteArray&))); 652 this,SLOT(systemMessage(const QCString&,const QByteArray&)));
653 d->m_initializedButtonQcop = true; 653 d->m_initializedButtonQcop = true;
654 } 654 }
655 655
656 Config cfg ( "ButtonSettings" ); 656 Config cfg ( "ButtonSettings" );
657 657
658 for ( uint i = 0; i < d->m_buttons->count(); i++ ) { 658 for ( uint i = 0; i < d->m_buttons->count(); i++ ) {
659 ODeviceButton &b = ( *d->m_buttons ) [i]; 659 ODeviceButton &b = ( *d->m_buttons ) [i];
660 QString group = "Button" + QString::number ( i ); 660 QString group = "Button" + QString::number ( i );
661 661
662 QCString pch, hch; 662 QCString pch, hch;
663 QCString pm, hm; 663 QCString pm, hm;
664 QByteArray pdata, hdata; 664 QByteArray pdata, hdata;
665 665
666 if ( cfg. hasGroup ( group )) { 666 if ( cfg. hasGroup ( group )) {
667 cfg. setGroup ( group ); 667 cfg. setGroup ( group );
668 pch = cfg. readEntry ( "PressedActionChannel" ). latin1(); 668 pch = cfg. readEntry ( "PressedActionChannel" ). latin1();
669 pm = cfg. readEntry ( "PressedActionMessage" ). latin1(); 669 pm = cfg. readEntry ( "PressedActionMessage" ). latin1();
670 // pdata = decodeBase64 ( buttonFile. readEntry ( "PressedActionArgs" )); 670 // pdata = decodeBase64 ( buttonFile. readEntry ( "PressedActionArgs" ));
671 671
672 hch = cfg. readEntry ( "HeldActionChannel" ). latin1(); 672 hch = cfg. readEntry ( "HeldActionChannel" ). latin1();
673 hm = cfg. readEntry ( "HeldActionMessage" ). latin1(); 673 hm = cfg. readEntry ( "HeldActionMessage" ). latin1();
674 // hdata = decodeBase64 ( buttonFile. readEntry ( "HeldActionArgs" )); 674 // hdata = decodeBase64 ( buttonFile. readEntry ( "HeldActionArgs" ));
675 } 675 }