summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/bluebase.cpp
Side-by-side diff
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 )
: BluetoothBase( parent, name, fl )
{
-
m_localDevice = new Manager( "hci0" );
@@ -67,7 +66,5 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
connect( rfcommBindButton, SIGNAL( clicked() ), this, SLOT( rfcommDialog() ) );
- // not good since lib is async
- // connect( devicesView, SIGNAL( expanded(QListViewItem*) ),
- // this, SLOT( addServicesToDevice(QListViewItem*) ) );
+
connect( devicesView, SIGNAL( clicked(QListViewItem*)),
this, SLOT( startServiceActionClicked(QListViewItem*) ) );
@@ -83,5 +80,4 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
this, SLOT( addSignalStrength(const QString&,const QString&) ) );
-
// let hold be rightButtonClicked()
QPEApplication::setStylusOperation( devicesView->viewport(), QPEApplication::RightOnHold);
@@ -107,12 +103,10 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
devicesView->setRootIsDecorated(true);
-
-
+ m_iconLoader = new BTIconLoader();
writeToHciConfig();
- // search conncetions
addConnectedDevices();
- addSignalStrength();
- m_iconLoader = new BTIconLoader();
readSavedDevices();
+ addServicesToDevices();
+ QTimer::singleShot( 3000, this, SLOT( addServicesToDevices() ) );
}
@@ -172,5 +166,5 @@ void BlueBase::writeToHciConfig()
/**
- * Read the list of allready known devices
+ * Read the list of already known devices
*/
void BlueBase::readSavedDevices()
@@ -186,5 +180,5 @@ void BlueBase::readSavedDevices()
/**
- * Write the list of allready known devices
+ * Write the list of already known devices
*/
void BlueBase::writeSavedDevices()
@@ -296,7 +290,4 @@ void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices )
// look if device is avail. atm, async
deviceActive( (*it) );
-
- // ggf auch hier?
- addServicesToDevice( deviceItem );
}
}
@@ -399,4 +390,15 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
+void BlueBase::addServicesToDevices()
+{
+ odebug << "BlueBase::addServicesToDevices()" << oendl;
+ BTDeviceItem* item = (BTDeviceItem*) devicesView->firstChild();
+ while ( item )
+ {
+ addServicesToDevice( item );
+ item = (BTDeviceItem*) static_cast<QListViewItem*>( item )->nextSibling();
+ }
+}
+
/**
* 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
void BlueBase::addServicesToDevice( BTDeviceItem * item )
{
- odebug << "addServicesToDevice" << oendl;
+ odebug << "BlueBase::addServicesToDevice" << oendl;
// row of mac adress text(3)
RemoteDevice device = item->remoteDevice();
@@ -415,6 +417,4 @@ void BlueBase::addServicesToDevice( BTDeviceItem * item )
/**
- * Overloaded. This one it the one that is
- ted to the foundServices signal
* @param device the mac address of the remote device
* @param servicesList the list with the service the device has.
@@ -422,5 +422,5 @@ void BlueBase::addServicesToDevice( BTDeviceItem * item )
void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList )
{
- odebug << "fill services list" << oendl;
+ odebug << "BlueBase::fill services list" << oendl;
QMap<QString,BTDeviceItem*>::Iterator it;
@@ -477,8 +477,4 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s
}
-
-
-
-
void BlueBase::addSignalStrength()
{
@@ -513,4 +509,5 @@ void BlueBase::addConnectedDevices()
{
m_localDevice->searchConnections();
+ QTimer::singleShot( 5000, this, SLOT( addSignalStrength() ) );
}
@@ -616,5 +613,4 @@ void BlueBase::deviceActive( const QString& device, bool connected )
BTDeviceItem* deviceItem = it.data();
-
if ( connected )
{