From 5521b2c0508cf6e6a390bd4796e8c9f2c7a6d05f Mon Sep 17 00:00:00 2001 From: korovkin Date: Wed, 10 May 2006 13:32:46 +0000 Subject: OBEX push functionality moved to libbluetooth1. Made some reformatting in device.cc In bluezapplet.cpp /etc/init.d/bluetooth is started synchronously if it's called from QCopMessage. --- (limited to 'noncore/net/opietooth/applet/bluezapplet.cpp') 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 @@ -116,7 +116,7 @@ namespace OpieTooth { } } - int BluezApplet::setBluezStatus(int c) { + int BluezApplet::setBluezStatus(int c, bool sync) { if ( c == 1 ) { switch ( ODevice::inst()->model() ) { @@ -138,8 +138,12 @@ namespace OpieTooth { 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 ) { @@ -169,7 +173,7 @@ namespace OpieTooth { if ( str == "enableBluetooth()") { m_wasOn = checkBluezStatus(); if (!m_wasOn) { - setBluezStatus(1); + setBluezStatus(1, true); sleep(2); } } -- cgit v0.9.0.2