Diffstat (limited to 'noncore/net/opietooth/applet/bluezapplet.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/opietooth/applet/bluezapplet.cpp | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/noncore/net/opietooth/applet/bluezapplet.cpp b/noncore/net/opietooth/applet/bluezapplet.cpp index f7774f0..127b0af 100644 --- a/noncore/net/opietooth/applet/bluezapplet.cpp +++ b/noncore/net/opietooth/applet/bluezapplet.cpp | |||
@@ -79,2 +79,3 @@ namespace OpieTooth { | |||
79 | m_wasOn = false; | 79 | m_wasOn = false; |
80 | m_sync = false; | ||
80 | 81 | ||
@@ -89,2 +90,3 @@ namespace OpieTooth { | |||
89 | if ( btDevice ) { | 90 | if ( btDevice ) { |
91 | ::system("/etc/init.d/bluetooth stop >/dev/null 2>/dev/null"); | ||
90 | delete btDevice; | 92 | delete btDevice; |
@@ -129,3 +131,3 @@ namespace OpieTooth { | |||
129 | 131 | ||
130 | #ifndef OPIE120 | 132 | #if OPIE_VERSION >= 102010 |
131 | case Model_MyPal_716: | 133 | case Model_MyPal_716: |
@@ -139,8 +141,6 @@ namespace OpieTooth { | |||
139 | } | 141 | } |
140 | if (sync) { | 142 | m_sync = sync; |
141 | ::system("/etc/init.d/bluetooth start >/dev/null 2>/dev/null"); | 143 | connect(btDevice, SIGNAL(device(const QString&, bool)), |
142 | } else { | 144 | this, SLOT(slotDevice(const QString&, bool))); |
143 | QCopEnvelope e("QPE/System", "execute(QString)"); | 145 | |
144 | e << QString("/etc/init.d/bluetooth start"); | ||
145 | } | ||
146 | } else { | 146 | } else { |
@@ -338,2 +338,19 @@ namespace OpieTooth { | |||
338 | } | 338 | } |
339 | /** | ||
340 | * Reacts on device up | ||
341 | * @param name device name | ||
342 | * @param up if device was brought up | ||
343 | */ | ||
344 | void BluezApplet::slotDevice(const QString& name, bool up) | ||
345 | { | ||
346 | if (!up) | ||
347 | return; | ||
348 | odebug << name << " is up" << oendl; | ||
349 | if (m_sync) { | ||
350 | ::system("/etc/init.d/bluetooth start >/dev/null 2>/dev/null"); | ||
351 | } else { | ||
352 | QCopEnvelope e("QPE/System", "execute(QString)"); | ||
353 | e << QString("/etc/init.d/bluetooth start"); | ||
354 | } | ||
355 | } | ||
339 | }; | 356 | }; |