summarylogtreecommitdiffstats
path: root/qtsixa-dbus.patch
blob: 41b2a3bcfe4d830eb841569bf15309928a2b312a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 diff -urp qtsixa.orig/qtsixa/gui/qtsixa_main.py qtsixa/qtsixa/gui/qtsixa_main.py
--- qtsixa.orig/qtsixa/gui/qtsixa_main.py	2012-12-06 22:59:03.103868725 -0800
+++ qtsixa/qtsixa/gui/qtsixa_main.py	2012-12-06 22:59:55.033596582 -0800
@@ -307,6 +307,8 @@ class MainW(QMainWindow, ui_qtsixa_mainw
     def func_DBusDisconnect(self, mode, name, mac):
         bus = dbus.SystemBus()
         try:
+            if (getoutput("qtsixa "+"--check-bluetoothd") == "0"):
+                raise
             bluez_bus = bus.get_object('org.bluez', '/')
             bluez_id = bluez_bus.DefaultAdapter(dbus_interface='org.bluez.Manager')
             adapter_bus = bus.get_object('org.bluez', bluez_id)
diff -urp qtsixa.orig/qtsixa/qtsixa qtsixa/qtsixa/qtsixa
--- qtsixa.orig/qtsixa/qtsixa	2012-12-06 22:59:03.107202042 -0800
+++ qtsixa/qtsixa/qtsixa	2012-12-06 22:59:17.417127047 -0800
@@ -68,6 +68,10 @@ fi
 echo "$ROOT"
     ;;
 
+    check-bluetoothd|-check-bluetoothd|--check-bluetoothd)
+ps -e | grep bluetoothd > /dev/null && echo "1" || echo "0"
+    ;;
+
     *)
 if [ -f ./gui/main.py ]; then
   exec python2 ./gui/main.py "$@"