Diffstat (limited to 'noncore/net/opietooth/applet') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/applet/bluezapplet.cpp | 15 | ||||
-rw-r--r-- | noncore/net/opietooth/applet/bluezapplet.h | 4 |
2 files changed, 12 insertions, 7 deletions
diff --git a/noncore/net/opietooth/applet/bluezapplet.cpp b/noncore/net/opietooth/applet/bluezapplet.cpp index 94e29c7..8bb7a93 100644 --- a/noncore/net/opietooth/applet/bluezapplet.cpp +++ b/noncore/net/opietooth/applet/bluezapplet.cpp | |||
@@ -62,15 +62,15 @@ namespace OpieTooth { | |||
62 | BluezApplet::~BluezApplet() { | 62 | BluezApplet::~BluezApplet() { |
63 | } | 63 | } |
64 | 64 | ||
65 | int BluezApplet::checkBluezStatus() { | 65 | bool BluezApplet::checkBluezStatus() { |
66 | if (btDevice) { | 66 | if (btDevice) { |
67 | if (btDevice->isLoaded() ) { | 67 | if (btDevice->isLoaded() ) { |
68 | return 1; | 68 | return true; |
69 | } else { | 69 | } else { |
70 | return 0; | 70 | return false; |
71 | } | 71 | } |
72 | } else { | 72 | } else { |
73 | return 0; | 73 | return false; |
74 | } | 74 | } |
75 | } | 75 | } |
76 | 76 | ||
@@ -128,19 +128,24 @@ namespace OpieTooth { | |||
128 | switch(ret) { | 128 | switch(ret) { |
129 | case 0: | 129 | case 0: |
130 | setBluezStatus(0); | 130 | setBluezStatus(0); |
131 | timerEvent(NULL); | ||
131 | break; | 132 | break; |
132 | case 1: | 133 | case 1: |
133 | setBluezStatus(1); | 134 | setBluezStatus(1); |
135 | timerEvent(NULL); | ||
134 | break; | 136 | break; |
135 | case 2: | 137 | case 2: |
136 | // start bluetoothmanager | 138 | // start bluetoothmanager |
137 | launchManager(); | 139 | launchManager(); |
140 | timerEvent(NULL); | ||
138 | break; | 141 | break; |
139 | case 3: | 142 | case 3: |
140 | setBluezDiscoveryStatus(0); | 143 | setBluezDiscoveryStatus(0); |
144 | timerEvent(NULL); | ||
141 | break; | 145 | break; |
142 | case 4: | 146 | case 4: |
143 | setBluezDiscoveryStatus(1); | 147 | setBluezDiscoveryStatus(1); |
148 | timerEvent(NULL); | ||
144 | break; | 149 | break; |
145 | //case 7: | 150 | //case 7: |
146 | // With table of currently-detected devices. | 151 | // With table of currently-detected devices. |
@@ -165,7 +170,7 @@ namespace OpieTooth { | |||
165 | * @param the timer event | 170 | * @param the timer event |
166 | */ | 171 | */ |
167 | void BluezApplet::timerEvent( QTimerEvent * ) { | 172 | void BluezApplet::timerEvent( QTimerEvent * ) { |
168 | int oldactive = bluezactive; | 173 | bool oldactive = bluezactive; |
169 | int olddiscovery = bluezDiscoveryActive; | 174 | int olddiscovery = bluezDiscoveryActive; |
170 | 175 | ||
171 | bluezactive = checkBluezStatus(); | 176 | bluezactive = checkBluezStatus(); |
diff --git a/noncore/net/opietooth/applet/bluezapplet.h b/noncore/net/opietooth/applet/bluezapplet.h index da05a18..6a8a00e 100644 --- a/noncore/net/opietooth/applet/bluezapplet.h +++ b/noncore/net/opietooth/applet/bluezapplet.h | |||
@@ -50,7 +50,7 @@ public slots: | |||
50 | void mousePressEvent( QMouseEvent * ); | 50 | void mousePressEvent( QMouseEvent * ); |
51 | void paintEvent( QPaintEvent* ); | 51 | void paintEvent( QPaintEvent* ); |
52 | void launchManager(); | 52 | void launchManager(); |
53 | int checkBluezStatus(); | 53 | bool checkBluezStatus(); |
54 | int setBluezStatus(int); | 54 | int setBluezStatus(int); |
55 | int checkBluezDiscoveryStatus(); | 55 | int checkBluezDiscoveryStatus(); |
56 | int setBluezDiscoveryStatus(int); | 56 | int setBluezDiscoveryStatus(int); |
@@ -61,7 +61,7 @@ public slots: | |||
61 | QPixmap bluezOnPixmap; | 61 | QPixmap bluezOnPixmap; |
62 | QPixmap bluezOffPixmap; | 62 | QPixmap bluezOffPixmap; |
63 | QPixmap bluezDiscoveryOnPixmap; | 63 | QPixmap bluezDiscoveryOnPixmap; |
64 | int bluezactive; | 64 | bool bluezactive; |
65 | int bluezDiscoveryActive; | 65 | int bluezDiscoveryActive; |
66 | 66 | ||
67 | private slots: | 67 | private slots: |