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.cpp40
1 files changed, 23 insertions, 17 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 3e7e2ab..d023302 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -38,2 +38,3 @@
#include <qpopupmenu.h>
+#include <qtimer.h>
@@ -67,2 +68,4 @@ namespace OpieTooth {
this, SLOT( deviceActive( const QString& , bool ) ) );
+ connect( localDevice, SIGNAL( connections( Connection::ValueList ) ),
+ this, SLOT( addConnectedDevices( Connection::ValueList ) ) );
@@ -94,2 +97,4 @@ namespace OpieTooth {
writeToHciConfig();
+ // search conncetions
+ addConnectedDevices();
}
@@ -297,7 +302,2 @@ namespace OpieTooth {
- // move into the c'tor
- // deviceItem->setMac( dev->mac() );
- // what kind of entry is it.
- //deviceItem->setType( "device");
-
// ggf auch hier?
@@ -412,12 +412,2 @@ namespace OpieTooth {
-
- // empty entries
- // QListViewItem * myChild = deviceItem->firstChild();
- //QList<QListViewItem*> tmpList;
- //while( myChild ) {
- // tmpList.append(myChild);
- // myChild = myChild->nextSibling();
- // }
-
-
QValueList<OpieTooth::Services>::Iterator it2;
@@ -441,9 +431,25 @@ namespace OpieTooth {
* Add the existing connections (pairs) to the connections tab.
- *
+ * This one triggers the search
*/
void BlueBase::addConnectedDevices() {
+ localDevice->searchConnections();
+ }
- //mac address
+ void BlueBase::addConnectedDevices( Connection::ValueList connectionList ) {
+
+ QValueList<OpieTooth::Connection>::Iterator it;
+ BTListItem * connectionItem;
+
+ if ( !connectionList.isEmpty() ) {
+
+ for (it = connectionList.begin(); it != connectionList.end(); ++it) {
+ connectionItem = new BTListItem( ListView4 , (*it).mac() , (*it).mac() , "connection" );
+ }
+ } else {
+ connectionItem = new BTListItem( ListView4 , tr("No connections found"), "", "connection" );
+ }
+ // recall connection search after some time
+ QTimer::singleShot( 20000, this, SLOT( addConnectedDevices() ) );
}