summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/applet/bluezapplet.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/opietooth/applet/bluezapplet.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/applet/bluezapplet.cpp8
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
@@ -53,29 +53,33 @@ namespace OpieTooth {
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;
}