From 3efe70df6fdaf32a8213ceadbdd1679a0a658934 Mon Sep 17 00:00:00 2001 From: erik Date: Tue, 06 Mar 2007 01:24:35 +0000 Subject: Bluetooth didn't quite work for kernel 2.6 based iPAQs in familiar. This patch fixes that by reading the distro supplied file in /etc/sysconfig. This patch was submitted by Slavek Banko. Thank you Slavek! --- diff --git a/noncore/net/opietooth/applet/bluezapplet.cpp b/noncore/net/opietooth/applet/bluezapplet.cpp index 787abc6..60fa4f8 100644 --- a/noncore/net/opietooth/applet/bluezapplet.cpp +++ b/noncore/net/opietooth/applet/bluezapplet.cpp @@ -52,6 +52,8 @@ using namespace Opie::Core; #include #include #include +#include +#include /* STD */ #include @@ -124,6 +126,25 @@ namespace OpieTooth { int BluezApplet::setBluezStatus(int c, bool sync) { if ( c == 1 ) { + QFile cfg("/etc/sysconfig/bluetooth"); + if ( cfg.open( IO_ReadOnly ) ) { + QTextStream stream( &cfg ); + QString streamIn = stream.read(); + QStringList list = QStringList::split( "\n", streamIn ); + cfg.close(); + if ( list.grep( "BLUETOOTH_PORT=" ).count() > 0 && + list.grep( "BLUETOOTH_PROTOCOL=" ).count() > 0 && + list.grep( "BLUETOOTH_SPEED=" ).count() > 0) + { + btDevice = + new Device( list.grep( "BLUETOOTH_PORT=" )[0].replace( QString( "BLUETOOTH_PORT=" ), ""), + list.grep( "BLUETOOTH_PROTOCOL=" )[0].replace( QString( "BLUETOOTH_PROTOCOL=" ), ""), + list.grep( "BLUETOOTH_SPEED=" )[0].replace( QString( "BLUETOOTH_SPEED=" ), "" ) ); + return 0; + } + } + + // Device-specific stuff - should be removed switch ( ODevice::inst()->model() ) { case Model_iPAQ_H39xx: btDevice = new Device( "/dev/tts/1", "bcsp", "921600" ); -- cgit v0.9.0.2