author | harlekin <harlekin> | 2003-03-09 23:16:17 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-03-09 23:16:17 (UTC) |
commit | a552546244601de73a4bdab071cb780309ed3c67 (patch) (side-by-side diff) | |
tree | 22a1ca9b06dbd9d254da7c99f59ca191c9de93b8 /noncore/net/opietooth | |
parent | 57e77709dcf3967c2ca4f83f7206b14c51ed3b03 (diff) | |
download | opie-a552546244601de73a4bdab071cb780309ed3c67.zip opie-a552546244601de73a4bdab071cb780309ed3c67.tar.gz opie-a552546244601de73a4bdab071cb780309ed3c67.tar.bz2 |
stop bluetooth when exiting opie
-rw-r--r-- | noncore/net/opietooth/applet/bluezapplet.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/noncore/net/opietooth/applet/bluezapplet.cpp b/noncore/net/opietooth/applet/bluezapplet.cpp index 3fdbde0..f1618ae 100644 --- a/noncore/net/opietooth/applet/bluezapplet.cpp +++ b/noncore/net/opietooth/applet/bluezapplet.cpp @@ -41,48 +41,51 @@ #include <qframe.h> #include <qpixmap.h> #include <qstring.h> #include <qtimer.h> #include <qpopupmenu.h> #include <device.h> namespace OpieTooth { BluezApplet::BluezApplet( QWidget *parent, const char *name ) : QWidget( parent, name ) { setFixedHeight( 18 ); setFixedWidth( 14 ); bluezOnPixmap = Resource::loadPixmap( "bluetoothapplet/bluezon" ); bluezOffPixmap = Resource::loadPixmap( "bluetoothapplet/bluezoff" ); // bluezDiscoveryOnPixmap = Resource::loadPixmap( "bluetoothapplet/magglass" ); startTimer(4000); btDevice = 0; bluezactive = false; bluezDiscoveryActive = false; } BluezApplet::~BluezApplet() { + if ( btDevice ) { + delete btDevice; + } } bool BluezApplet::checkBluezStatus() { if (btDevice) { if (btDevice->isLoaded() ) { return true; } else { return false; } } else { return false; } } int BluezApplet::setBluezStatus(int c) { if (c == 1) { btDevice = new Device("/dev/ttySB0", "bcsp", "230400" ); } else { if (btDevice) { delete btDevice; btDevice = 0; } } |