summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/io_bt.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console/io_bt.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/io_bt.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp
index 4486eea..8dd8151 100644
--- a/noncore/apps/opie-console/io_bt.cpp
+++ b/noncore/apps/opie-console/io_bt.cpp
@@ -21,12 +21,13 @@ void IOBt::close() {
delete m_attach;
m_attach = 0;
}
}
bool IOBt::open() {
+ bool ret = false;
// only set up bt stuff if mac address was set, otherwise use the device set
if ( !m_mac.isEmpty() ) {
// now it should also be checked, if there is a connection to the device with that mac allready
// hciattach here
@@ -36,24 +37,25 @@ bool IOBt::open() {
// then start hcid, then rcfomm handling (m_mac)
connect( m_attach, SIGNAL( processExited( OProcess* ) ),
this, SLOT( slotExited( OProcess* ) ) );
if ( m_attach->start() ) {
- IOSerial::open();
+ ret = IOSerial::open();
} else {
qWarning("could not attach to device");
delete m_attach;
m_attach = 0;
}
} else {
// directly to the normal serial
// TODO: look first if the connection really exists. ( is set up )
- IOSerial::open();
+ ret =IOSerial::open();
}
+ return ret;
}
void IOBt::reload( const Profile &config ) {
m_device = config.readEntry("Device", BT_DEFAULT_DEVICE);
m_mac = config.readEntry("Mac", BT_DEFAULT_MAC);
m_baud = config.readNumEntry("Baud", BT_DEFAULT_BAUD);
@@ -71,7 +73,8 @@ QString IOBt::identifier() const {
QString IOBt::name() const {
return "BLuetooth IO Layer";
}
void IOBt::slotExited( OProcess* proc ){
close();
+ delete proc;
}