summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/bluebase.cpp
Unidiff
Diffstat (limited to 'noncore/net/opietooth/manager/bluebase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp44
1 files changed, 20 insertions, 24 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index af1cd23..0649514 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -60,5 +60,4 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
60 : BluetoothBase( parent, name, fl ) 60 : BluetoothBase( parent, name, fl )
61{ 61{
62
63 m_localDevice = new Manager( "hci0" ); 62 m_localDevice = new Manager( "hci0" );
64 63
@@ -67,7 +66,5 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
67 66
68 connect( rfcommBindButton, SIGNAL( clicked() ), this, SLOT( rfcommDialog() ) ); 67 connect( rfcommBindButton, SIGNAL( clicked() ), this, SLOT( rfcommDialog() ) );
69 // not good since lib is async 68
70 // connect( devicesView, SIGNAL( expanded(QListViewItem*) ),
71 // this, SLOT( addServicesToDevice(QListViewItem*) ) );
72 connect( devicesView, SIGNAL( clicked(QListViewItem*)), 69 connect( devicesView, SIGNAL( clicked(QListViewItem*)),
73 this, SLOT( startServiceActionClicked(QListViewItem*) ) ); 70 this, SLOT( startServiceActionClicked(QListViewItem*) ) );
@@ -83,5 +80,4 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
83 this, SLOT( addSignalStrength(const QString&,const QString&) ) ); 80 this, SLOT( addSignalStrength(const QString&,const QString&) ) );
84 81
85
86 // let hold be rightButtonClicked() 82 // let hold be rightButtonClicked()
87 QPEApplication::setStylusOperation( devicesView->viewport(), QPEApplication::RightOnHold); 83 QPEApplication::setStylusOperation( devicesView->viewport(), QPEApplication::RightOnHold);
@@ -107,12 +103,10 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
107 103
108 devicesView->setRootIsDecorated(true); 104 devicesView->setRootIsDecorated(true);
109 105 m_iconLoader = new BTIconLoader();
110
111 writeToHciConfig(); 106 writeToHciConfig();
112 // search conncetions
113 addConnectedDevices(); 107 addConnectedDevices();
114 addSignalStrength();
115 m_iconLoader = new BTIconLoader();
116 readSavedDevices(); 108 readSavedDevices();
109 addServicesToDevices();
110 QTimer::singleShot( 3000, this, SLOT( addServicesToDevices() ) );
117} 111}
118 112
@@ -172,5 +166,5 @@ void BlueBase::writeToHciConfig()
172 166
173/** 167/**
174 * Read the list of allready known devices 168 * Read the list of already known devices
175 */ 169 */
176void BlueBase::readSavedDevices() 170void BlueBase::readSavedDevices()
@@ -186,5 +180,5 @@ void BlueBase::readSavedDevices()
186 180
187/** 181/**
188 * Write the list of allready known devices 182 * Write the list of already known devices
189 */ 183 */
190void BlueBase::writeSavedDevices() 184void BlueBase::writeSavedDevices()
@@ -296,7 +290,4 @@ void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices )
296 // look if device is avail. atm, async 290 // look if device is avail. atm, async
297 deviceActive( (*it) ); 291 deviceActive( (*it) );
298
299 // ggf auch hier?
300 addServicesToDevice( deviceItem );
301 } 292 }
302} 293}
@@ -399,4 +390,15 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
399 390
400 391
392void BlueBase::addServicesToDevices()
393{
394 odebug << "BlueBase::addServicesToDevices()" << oendl;
395 BTDeviceItem* item = (BTDeviceItem*) devicesView->firstChild();
396 while ( item )
397 {
398 addServicesToDevice( item );
399 item = (BTDeviceItem*) static_cast<QListViewItem*>( item )->nextSibling();
400 }
401}
402
401/** 403/**
402 * Search and display avail. services for a device (on expand from device listing) 404 * Search and display avail. services for a device (on expand from device listing)
@@ -405,5 +407,5 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
405void BlueBase::addServicesToDevice( BTDeviceItem * item ) 407void BlueBase::addServicesToDevice( BTDeviceItem * item )
406{ 408{
407 odebug << "addServicesToDevice" << oendl; 409 odebug << "BlueBase::addServicesToDevice" << oendl;
408 // row of mac adress text(3) 410 // row of mac adress text(3)
409 RemoteDevice device = item->remoteDevice(); 411 RemoteDevice device = item->remoteDevice();
@@ -415,6 +417,4 @@ void BlueBase::addServicesToDevice( BTDeviceItem * item )
415 417
416/** 418/**
417 * Overloaded. This one it the one that is
418 ted to the foundServices signal
419 * @param device the mac address of the remote device 419 * @param device the mac address of the remote device
420 * @param servicesList the list with the service the device has. 420 * @param servicesList the list with the service the device has.
@@ -422,5 +422,5 @@ void BlueBase::addServicesToDevice( BTDeviceItem * item )
422void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList ) 422void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList )
423{ 423{
424 odebug << "fill services list" << oendl; 424 odebug << "BlueBase::fill services list" << oendl;
425 425
426 QMap<QString,BTDeviceItem*>::Iterator it; 426 QMap<QString,BTDeviceItem*>::Iterator it;
@@ -477,8 +477,4 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s
477} 477}
478 478
479
480
481
482
483void BlueBase::addSignalStrength() 479void BlueBase::addSignalStrength()
484{ 480{
@@ -513,4 +509,5 @@ void BlueBase::addConnectedDevices()
513{ 509{
514 m_localDevice->searchConnections(); 510 m_localDevice->searchConnections();
511 QTimer::singleShot( 5000, this, SLOT( addSignalStrength() ) );
515} 512}
516 513
@@ -616,5 +613,4 @@ void BlueBase::deviceActive( const QString& device, bool connected )
616 BTDeviceItem* deviceItem = it.data(); 613 BTDeviceItem* deviceItem = it.data();
617 614
618
619 if ( connected ) 615 if ( connected )
620 { 616 {