author | harlekin <harlekin> | 2002-06-01 23:55:11 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-06-01 23:55:11 (UTC) |
commit | 34b68507898f2a01333281a7293d0bbd3c6d77ee (patch) (side-by-side diff) | |
tree | 3a620603d62d9c6bc52c00bf08c3f207c7814763 /noncore | |
parent | 4f60b99a11c74a297c2471fd272735c9d8f9611f (diff) | |
download | opie-34b68507898f2a01333281a7293d0bbd3c6d77ee.zip opie-34b68507898f2a01333281a7293d0bbd3c6d77ee.tar.gz opie-34b68507898f2a01333281a7293d0bbd3c6d77ee.tar.bz2 |
segfault fixed
-rw-r--r-- | noncore/net/opietooth/applet/bluezapplet.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/noncore/net/opietooth/applet/bluezapplet.cpp b/noncore/net/opietooth/applet/bluezapplet.cpp index b662ff7..39a9c6e 100644 --- a/noncore/net/opietooth/applet/bluezapplet.cpp +++ b/noncore/net/opietooth/applet/bluezapplet.cpp @@ -41,53 +41,57 @@ #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(5000); timerEvent(NULL); } BluezApplet::~BluezApplet() { } int BluezApplet::checkBluezStatus() { - if (btDevice->isLoaded() ) { - return 1; + if (btDevice) { + if (btDevice->isLoaded() ) { + return 1; } else { return 0; } + } else { + return 0; + } } int BluezApplet::setBluezStatus(int c) { if (c == 1) { btDevice = new Device("/dev/ttySB0", "scr" ); // system("hciattach /dev/ttySB0 csr"); //system("hcid"); } else { if (btDevice) { delete btDevice; } //system("killall hciattach"); //system("killall hcid"); } return 0; } int BluezApplet::checkBluezDiscoveryStatus() { } int BluezApplet::setBluezDiscoveryStatus(int d) { } |