Diffstat (limited to 'noncore/net/opietooth/manager/bluebase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index 8b15c4f..9663b52 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp | |||
@@ -73,4 +73,6 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) | |||
73 | connect( m_localDevice, SIGNAL( connections( ConnectionState::ValueList ) ), | 73 | connect( m_localDevice, SIGNAL( connections( ConnectionState::ValueList ) ), |
74 | this, SLOT( addConnectedDevices( ConnectionState::ValueList ) ) ); | 74 | this, SLOT( addConnectedDevices( ConnectionState::ValueList ) ) ); |
75 | connect( m_localDevice, SIGNAL( signalStrength( const QString&, const QString& ) ), | ||
76 | this, SLOT( addSignalStrength( const QString&, const QString& ) ) ); | ||
75 | 77 | ||
76 | 78 | ||
@@ -99,7 +101,9 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) | |||
99 | ListView2->setRootIsDecorated(true); | 101 | ListView2->setRootIsDecorated(true); |
100 | 102 | ||
103 | |||
101 | writeToHciConfig(); | 104 | writeToHciConfig(); |
102 | // search conncetions | 105 | // search conncetions |
103 | addConnectedDevices(); | 106 | addConnectedDevices(); |
107 | addSignalStrength(); | ||
104 | m_iconLoader = new BTIconLoader(); | 108 | m_iconLoader = new BTIconLoader(); |
105 | readSavedDevices(); | 109 | readSavedDevices(); |
@@ -371,5 +375,6 @@ void BlueBase::addServicesToDevice( BTDeviceItem * item ) { | |||
371 | 375 | ||
372 | /** | 376 | /** |
373 | * Overloaded. This one it the one that is connected to the foundServices signal | 377 | * Overloaded. This one it the one that is |
378 | ted to the foundServices signal | ||
374 | * @param device the mac address of the remote device | 379 | * @param device the mac address of the remote device |
375 | * @param servicesList the list with the service the device has. | 380 | * @param servicesList the list with the service the device has. |
@@ -426,4 +431,27 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s | |||
426 | 431 | ||
427 | 432 | ||
433 | |||
434 | |||
435 | |||
436 | void BlueBase::addSignalStrength() { | ||
437 | |||
438 | QListViewItemIterator it( ListView4 ); | ||
439 | for ( ; it.current(); ++it ) { | ||
440 | m_localDevice->signalStrength( ((BTConnectionItem*)it.current() )->connection().mac() ); | ||
441 | } | ||
442 | |||
443 | QTimer::singleShot( 5000, this, SLOT( addSignalStrength() ) ); | ||
444 | } | ||
445 | |||
446 | void BlueBase::addSignalStrength( const QString& mac, const QString& strength ) { | ||
447 | |||
448 | QListViewItemIterator it( ListView4 ); | ||
449 | for ( ; it.current(); ++it ) { | ||
450 | if( ((BTConnectionItem*)it.current())->connection().mac() == mac ) { | ||
451 | ((BTConnectionItem*)it.current() )->setSignalStrength( strength ); | ||
452 | } | ||
453 | } | ||
454 | } | ||
455 | |||
428 | /** | 456 | /** |
429 | * Add the existing connections (pairs) to the connections tab. | 457 | * Add the existing connections (pairs) to the connections tab. |
@@ -434,5 +462,4 @@ void BlueBase::addConnectedDevices() { | |||
434 | } | 462 | } |
435 | 463 | ||
436 | |||
437 | /** | 464 | /** |
438 | * This adds the found connections to the connection tab. | 465 | * This adds the found connections to the connection tab. |
@@ -450,6 +477,11 @@ void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) | |||
450 | 477 | ||
451 | for (it = connectionList.begin(); it != connectionList.end(); ++it) { | 478 | for (it = connectionList.begin(); it != connectionList.end(); ++it) { |
452 | connectionItem = new BTConnectionItem( ListView4 , (*it) ); | 479 | connectionItem = new BTConnectionItem( ListView4, (*it) ); |
453 | } | 480 | |
481 | if( m_deviceList.find((*it).mac()).data() ) { | ||
482 | |||
483 | connectionItem->setName( m_deviceList.find( (*it).mac()).data()->name() ); | ||
484 | } | ||
485 | } | ||
454 | } else { | 486 | } else { |
455 | ConnectionState con; | 487 | ConnectionState con; |