diff options
author | Paul Sokolovsky <pmiscml@gmail.com> | 2007-02-12 10:09:52 +0000 |
---|---|---|
committer | Paul Sokolovsky <pmiscml@gmail.com> | 2007-02-12 10:09:52 +0000 |
commit | 02e1e481c64ff5fbc4e5e4e611cc64c1b61eb1d6 (patch) | |
tree | f5801b035c5befe738131b3da84ad99cd469efd4 /packages/opie-bluetoothapplet | |
parent | 7943a48178b7ee06a8416a9fa4b461d65cfdaaf5 (diff) |
opie-bluetoothapplet cvs: Patch to get BT params from /etc/sysconfig/bluetooth
* instead of hardcoding in C++ code.
* Originally by Slavek Banko, http://handhelds.org/hypermail/opie-devel/29/2946.html
* Submitted upstream as http://opie-bugs.oszine.de/view.php?id=1838
Diffstat (limited to 'packages/opie-bluetoothapplet')
3 files changed, 43 insertions, 1 deletions
diff --git a/packages/opie-bluetoothapplet/files/.mtn2git_empty b/packages/opie-bluetoothapplet/files/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/packages/opie-bluetoothapplet/files/.mtn2git_empty diff --git a/packages/opie-bluetoothapplet/files/sysconfig-bluetooth.patch b/packages/opie-bluetoothapplet/files/sysconfig-bluetooth.patch new file mode 100644 index 0000000000..83ee765b12 --- /dev/null +++ b/packages/opie-bluetoothapplet/files/sysconfig-bluetooth.patch @@ -0,0 +1,40 @@ +--- applet.org/bluezapplet.cpp.org 2007-02-11 16:48:06.000000000 +0000 ++++ applet/bluezapplet.cpp 2007-02-11 16:56:57.000000000 +0000 +@@ -52,6 +52,8 @@ + #include <qtimer.h> + #include <qpopupmenu.h> + #include <qmessagebox.h> ++#include <qfile.h> ++#include <qtextstream.h> + + /* STD */ + #include <device.h> +@@ -124,6 +126,28 @@ + 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" ); diff --git a/packages/opie-bluetoothapplet/opie-bluetoothapplet_cvs.bb b/packages/opie-bluetoothapplet/opie-bluetoothapplet_cvs.bb index bf9cc5689b..a919c3094b 100644 --- a/packages/opie-bluetoothapplet/opie-bluetoothapplet_cvs.bb +++ b/packages/opie-bluetoothapplet/opie-bluetoothapplet_cvs.bb @@ -1,6 +1,8 @@ require ${PN}.inc PV = "${OPIE_CVS_PV}" +PR = "r1" SRC_URI = "${HANDHELDS_CVS};module=opie/noncore/net/opietooth/applet \ - ${HANDHELDS_CVS};module=opie/pics/bluetoothapplet" + ${HANDHELDS_CVS};module=opie/pics/bluetoothapplet \ + file://sysconfig-bluetooth.patch;patch=1" |