summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/applet
Side-by-side diff
Diffstat (limited to 'noncore/net/opietooth/applet') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/applet/bluezapplet.cpp12
-rw-r--r--noncore/net/opietooth/applet/bluezapplet.h2
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
@@ -118,3 +118,3 @@ namespace OpieTooth {
- int BluezApplet::setBluezStatus(int c) {
+ int BluezApplet::setBluezStatus(int c, bool sync) {
@@ -140,4 +140,8 @@ namespace OpieTooth {
}
- 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 {
@@ -171,3 +175,3 @@ namespace OpieTooth {
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
@@ -57,3 +57,3 @@ public slots:
bool checkBluezStatus();
- int setBluezStatus(int);
+ int setBluezStatus(int, bool sync = false);
int checkBluezDiscoveryStatus();