Diffstat (limited to 'noncore/net/opietooth/applet') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/applet/bluezapplet.cpp | 12 | ||||
-rw-r--r-- | noncore/net/opietooth/applet/bluezapplet.h | 2 |
2 files changed, 9 insertions, 5 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 @@ -117,5 +117,5 @@ namespace OpieTooth { } - int BluezApplet::setBluezStatus(int c) { + int BluezApplet::setBluezStatus(int c, bool sync) { if ( c == 1 ) { @@ -139,6 +139,10 @@ namespace OpieTooth { 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"); @@ -170,5 +174,5 @@ namespace OpieTooth { m_wasOn = checkBluezStatus(); if (!m_wasOn) { - setBluezStatus(1); + setBluezStatus(1, true); sleep(2); } diff --git a/noncore/net/opietooth/applet/bluezapplet.h b/noncore/net/opietooth/applet/bluezapplet.h index 90bee3b..1937934 100644 --- a/noncore/net/opietooth/applet/bluezapplet.h +++ b/noncore/net/opietooth/applet/bluezapplet.h @@ -56,5 +56,5 @@ public slots: void launchManager(); bool checkBluezStatus(); - int setBluezStatus(int); + int setBluezStatus(int, bool sync = false); int checkBluezDiscoveryStatus(); int setBluezDiscoveryStatus(int); |