Diffstat (limited to 'noncore/net/opietooth/applet/bluezapplet.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/applet/bluezapplet.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/noncore/net/opietooth/applet/bluezapplet.cpp b/noncore/net/opietooth/applet/bluezapplet.cpp index 90b0c6d..6351d4e 100644 --- a/noncore/net/opietooth/applet/bluezapplet.cpp +++ b/noncore/net/opietooth/applet/bluezapplet.cpp @@ -115,9 +115,9 @@ namespace OpieTooth { return false; } } - int BluezApplet::setBluezStatus(int c) { + int BluezApplet::setBluezStatus(int c, bool sync) { if ( c == 1 ) { switch ( ODevice::inst()->model() ) { case Model_iPAQ_H39xx: @@ -137,10 +137,14 @@ namespace OpieTooth { default: btDevice = new Device( "/dev/ttySB0", "bcsp", "230400" ); break; } - QCopEnvelope e("QPE/System", "execute(QString)"); - e << QString("/etc/init.d/bluetooth start"); + if (sync) { + ::system("/etc/init.d/bluetooth start >/dev/null 2>/dev/null"); + } else { + QCopEnvelope e("QPE/System", "execute(QString)"); + e << QString("/etc/init.d/bluetooth start"); + } } else { ::system("/etc/init.d/bluetooth stop >/dev/null 2>/dev/null"); if ( btManager ) { delete btManager; @@ -168,9 +172,9 @@ namespace OpieTooth { { if ( str == "enableBluetooth()") { m_wasOn = checkBluezStatus(); if (!m_wasOn) { - setBluezStatus(1); + setBluezStatus(1, true); sleep(2); } } else if ( str == "disableBluetooth()") { |