summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-03-06 22:22:51 (UTC)
committer harlekin <harlekin>2003-03-06 22:22:51 (UTC)
commite2165a29b9fc618037295fc7515e0364b9a3da4f (patch) (unidiff)
tree72dfa3c16132e83f84c8300150c47c05e0da7cde
parent56eadb23f09da3823da787d98c0f2478620a15b3 (diff)
downloadopie-e2165a29b9fc618037295fc7515e0364b9a3da4f.zip
opie-e2165a29b9fc618037295fc7515e0364b9a3da4f.tar.gz
opie-e2165a29b9fc618037295fc7515e0364b9a3da4f.tar.bz2
activate connections tab
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/lib/manager.cc7
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp2
-rw-r--r--noncore/net/opietooth/manager/btconnectionitem.cpp1
3 files changed, 6 insertions, 4 deletions
diff --git a/noncore/net/opietooth/lib/manager.cc b/noncore/net/opietooth/lib/manager.cc
index 1281116..59ade6d 100644
--- a/noncore/net/opietooth/lib/manager.cc
+++ b/noncore/net/opietooth/lib/manager.cc
@@ -250,34 +250,35 @@ void Manager::searchConnections() {
250 this, SLOT(slotConnectionExited( OProcess*) ) ); 250 this, SLOT(slotConnectionExited( OProcess*) ) );
251 connect(proc, SIGNAL(receivedStdout(OProcess*, char*, int) ), 251 connect(proc, SIGNAL(receivedStdout(OProcess*, char*, int) ),
252 this, SLOT(slotConnectionOutput(OProcess*, char*, int) ) ); 252 this, SLOT(slotConnectionOutput(OProcess*, char*, int) ) );
253 *proc << "hcitool"; 253 *proc << "hcitool";
254 *proc << "con"; 254 *proc << "con";
255 255
256 if (!proc->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 256 if (!proc->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
257 ConnectionState::ValueList list; 257 ConnectionState::ValueList list;
258 emit connections( list ); 258 emit connections( list );
259 delete proc; 259 delete proc;
260 } 260 }
261} 261}
262void Manager::slotConnectionExited( OProcess* /*proc*/ ) { 262void Manager::slotConnectionExited( OProcess* proc ) {
263 qWarning("exited"); 263 qWarning("<<<<<<<<<<<<<<<<<exited");
264 ConnectionState::ValueList list; 264 ConnectionState::ValueList list;
265 list = parseConnections( m_hcitoolCon ); 265 list = parseConnections( m_hcitoolCon );
266 emit connections(list ); 266 emit connections(list );
267 delete proc;
267} 268}
268void Manager::slotConnectionOutput(OProcess* proc, char* cha, int len) { 269void Manager::slotConnectionOutput(OProcess* proc, char* cha, int len) {
269 QCString str(cha, len ); 270 QCString str(cha, len );
270 m_hcitoolCon.append( str ); 271 m_hcitoolCon.append( str );
271 delete proc; 272 //delete proc;
272} 273}
273ConnectionState::ValueList Manager::parseConnections( const QString& out ) { 274ConnectionState::ValueList Manager::parseConnections( const QString& out ) {
274 ConnectionState::ValueList list2; 275 ConnectionState::ValueList list2;
275 QStringList list = QStringList::split('\n', out ); 276 QStringList list = QStringList::split('\n', out );
276 QStringList::Iterator it; 277 QStringList::Iterator it;
277 for (it = list.begin(); it != list.end(); ++it ) { 278 for (it = list.begin(); it != list.end(); ++it ) {
278 QString row = (*it).stripWhiteSpace(); 279 QString row = (*it).stripWhiteSpace();
279 QStringList value = QStringList::split(' ', row ); 280 QStringList value = QStringList::split(' ', row );
280 qWarning("0: %s", value[0].latin1() ); 281 qWarning("0: %s", value[0].latin1() );
281 qWarning("1: %s", value[1].latin1() ); 282 qWarning("1: %s", value[1].latin1() );
282 qWarning("2: %s", value[2].latin1() ); 283 qWarning("2: %s", value[2].latin1() );
283 qWarning("3: %s", value[3].latin1() ); 284 qWarning("3: %s", value[3].latin1() );
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index d3abb54..5c5f069 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -409,25 +409,25 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s
409 serviceItem = new BTServiceItem( deviceItem, s1 ); 409 serviceItem = new BTServiceItem( deviceItem, s1 );
410 } 410 }
411 // now remove them from the list 411 // now remove them from the list
412 m_deviceList.remove( it ); 412 m_deviceList.remove( it );
413} 413}
414 414
415 415
416/** 416/**
417 * Add the existing connections (pairs) to the connections tab. 417 * Add the existing connections (pairs) to the connections tab.
418 * This one triggers the search 418 * This one triggers the search
419 */ 419 */
420void BlueBase::addConnectedDevices() { 420void BlueBase::addConnectedDevices() {
421 m_localDevice->searchConnections(); 421 m_localDevice->searchConnections();
422} 422}
423 423
424 424
425/** 425/**
426 * This adds the found connections to the connection tab. 426 * This adds the found connections to the connection tab.
427 * @param connectionList the ValueList with all current connections 427 * @param connectionList the ValueList with all current connections
428 */ 428 */
429void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) { 429void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) {
430 430
431 // clear the ListView first 431 // clear the ListView first
432 ListView4->clear(); 432 ListView4->clear();
433 433
diff --git a/noncore/net/opietooth/manager/btconnectionitem.cpp b/noncore/net/opietooth/manager/btconnectionitem.cpp
index 6fb9c11..b57d1b3 100644
--- a/noncore/net/opietooth/manager/btconnectionitem.cpp
+++ b/noncore/net/opietooth/manager/btconnectionitem.cpp
@@ -1,21 +1,22 @@
1#include <connection.h> 1#include <connection.h>
2#include "btconnectionitem.h" 2#include "btconnectionitem.h"
3 3
4using namespace OpieTooth; 4using namespace OpieTooth;
5 5
6BTConnectionItem::BTConnectionItem( QListView* parent, const ConnectionState& con ) 6BTConnectionItem::BTConnectionItem( QListView* parent, const ConnectionState& con )
7 : BTListItem( parent ){ 7 : BTListItem( parent ){
8 m_con = con; 8 m_con = con;
9 setText(0, m_con.mac() ); 9 setText(0, m_con.mac() );
10 setText(1, m_con.connectionMode() );
10} 11}
11BTConnectionItem::~BTConnectionItem() { 12BTConnectionItem::~BTConnectionItem() {
12 13
13} 14}
14QString BTConnectionItem::type() const { 15QString BTConnectionItem::type() const {
15 return QString::fromLatin1("connection"); 16 return QString::fromLatin1("connection");
16} 17}
17int BTConnectionItem::typeId() const { 18int BTConnectionItem::typeId() const {
18 return Connection; 19 return Connection;
19} 20}
20ConnectionState BTConnectionItem::connection() const { 21ConnectionState BTConnectionItem::connection() const {
21 return m_con; 22 return m_con;