summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice.cpp
authorzecke <zecke>2004-10-13 13:00:45 (UTC)
committer zecke <zecke>2004-10-13 13:00:45 (UTC)
commit72065f1f1aa12882ae63f8b063312e96dd683156 (patch) (side-by-side diff)
tree0e4a68f4aac3cc8686987d03adc323a795db6b5c /libopie2/opiecore/device/odevice.cpp
parentc931e96eb4bf7df64bca49c2343f2203bac637ba (diff)
downloadopie-72065f1f1aa12882ae63f8b063312e96dd683156.zip
opie-72065f1f1aa12882ae63f8b063312e96dd683156.tar.gz
opie-72065f1f1aa12882ae63f8b063312e96dd683156.tar.bz2
-Create the QPE/System channel in ODevice to listen for button remapping
-Remove various connect and QCopChannel creation from actual device implementations Let us see if that breaks anything, I hope SIMpad still will do fine. We might need to guard if a qApp exists?
Diffstat (limited to 'libopie2/opiecore/device/odevice.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp13
1 files changed, 10 insertions, 3 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
@@ -177,6 +177,9 @@ 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.
@@ -233,9 +236,6 @@ void ODevice::initButtons()
}
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()
@@ -645,6 +645,13 @@ 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" );