-rw-r--r-- | libopie2/opiecore/device/odevice.cpp | 13 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice.h | 1 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_ipaq.cpp | 3 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_jornada.cpp | 3 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_yopy.cpp | 4 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 4 |
6 files changed, 11 insertions, 17 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp index 8b64c41..67cae1c 100644 --- a/libopie2/opiecore/device/odevice.cpp +++ b/libopie2/opiecore/device/odevice.cpp @@ -176,8 +176,11 @@ ODevice::ODevice() /* mixer */ d->m_sound = d->m_vol = d->m_mixer = -1; + + /* System QCopChannel created */ + d->m_initializedButtonQcop = false; // New distribution detection code first checks for legacy distributions, // identified by /etc/familiar-version or /etc/oz_version. // Then check for OpenEmbedded and lastly, read /etc/issue @@ -232,11 +235,8 @@ void ODevice::initButtons() d->m_buttons->append ( b ); } reloadButtonMapping(); - - QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); - connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); } ODevice::~ODevice() { @@ -644,8 +644,15 @@ const ODeviceButton *ODevice::buttonForKeycode ( ushort code ) void ODevice::reloadButtonMapping() { initButtons(); + + if(!d->m_initializedButtonQcop) { + QCopChannel *chan = new QCopChannel("QPE/System", this, "ODevice button channel"); + connect(chan,SIGNAL(received(const QCString&,const QByteArray&)), + this,SLOT(systemMessage(const QCString&,const QByteArray&))); + d->m_initializedButtonQcop = true; + } Config cfg ( "ButtonSettings" ); for ( uint i = 0; i < d->m_buttons->count(); i++ ) { diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index 6f0d036..21fcc3f 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h @@ -356,8 +356,9 @@ class ODeviceData { QValueList <ODeviceButton> *m_buttons; uint m_holdtime; QStrList *m_cpu_frequencies; + bool m_initializedButtonQcop : 1; /* values for changeMixerForAlarm */ int m_sound, m_vol, m_mixer; }; diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp index 6193ddc..9e01a0c 100644 --- a/libopie2/opiecore/device/odevice_ipaq.cpp +++ b/libopie2/opiecore/device/odevice_ipaq.cpp @@ -188,11 +188,8 @@ void iPAQ::initButtons() d->m_buttons->append ( b ); } } reloadButtonMapping(); - - QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); - connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); } QValueList <OLed> iPAQ::ledList() const { diff --git a/libopie2/opiecore/device/odevice_jornada.cpp b/libopie2/opiecore/device/odevice_jornada.cpp index 2cab0c8..8141f1c 100644 --- a/libopie2/opiecore/device/odevice_jornada.cpp +++ b/libopie2/opiecore/device/odevice_jornada.cpp @@ -139,11 +139,8 @@ void Jornada::initButtons() d->m_buttons->append ( b ); } } reloadButtonMapping(); - - QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); - connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); } int Jornada::displayBrightnessResolution() const { diff --git a/libopie2/opiecore/device/odevice_yopy.cpp b/libopie2/opiecore/device/odevice_yopy.cpp index a06d7ec..8f22514 100644 --- a/libopie2/opiecore/device/odevice_yopy.cpp +++ b/libopie2/opiecore/device/odevice_yopy.cpp @@ -108,12 +108,8 @@ void Yopy::initButtons() d->m_buttons->append ( b ); } reloadButtonMapping(); - - QCopChannel *sysch = new QCopChannel( "QPE/System", this ); - connect( sysch, SIGNAL( received(const QCString&,const QByteArray&) ), - this, SLOT( systemMessage(const QCString&,const QByteArray&) ) ); } bool Yopy::suspend() diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index 733479e..ebe1949 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp @@ -237,12 +237,8 @@ void Zaurus::initButtons() d->m_buttons->append ( b ); } reloadButtonMapping(); - - QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); - connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), - this, SLOT( systemMessage(const QCString&,const QByteArray&))); } #include <unistd.h> #include <fcntl.h> |