From 56788c49b68bae137a51b089b911f7ec4977c33f Mon Sep 17 00:00:00 2001 From: harlekin Date: Sun, 16 Jun 2002 20:44:48 +0000 Subject: remoteDevice part II --- diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index 71da82e..c993c7c 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -41,7 +42,8 @@ namespace OpieTooth { - class RemoteDevices; + + #include BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) : BluetoothBase( parent, name, fl ) { @@ -153,10 +155,19 @@ namespace OpieTooth { } - void BlueBase::addSearchedDevices( QList &newDevices ) { + void BlueBase::addSearchedDevices( QList &newDevices ) { + + QListViewItem * deviceItem; + + QListIterator it(newDevices); + for( ; it.current(); ++it ) { + RemoteDevice *dev = it.current(); + deviceItem = new QListViewItem( ListView4, dev->name() ); + deviceItem->setText(1, dev->mac() ); + } } @@ -165,8 +176,8 @@ namespace OpieTooth { */ void BlueBase::startScan() { ScanDialog *scan = new ScanDialog( this, "", true); - QObject::connect((QObject*)scan, SIGNAL( selectedDevices(QList&) ), - this, SLOT( addSearchedDevices(QList& ) )); + QObject::connect((QObject*)scan, SIGNAL( selectedDevices(QList&) ), + this, SLOT( addSearchedDevices(QList& ) )); scan->showMaximized(); } diff --git a/noncore/net/opietooth/manager/bluebase.h b/noncore/net/opietooth/manager/bluebase.h index 5364e51..c8ceed2 100644 --- a/noncore/net/opietooth/manager/bluebase.h +++ b/noncore/net/opietooth/manager/bluebase.h @@ -53,7 +53,7 @@ namespace OpieTooth { int enableInquiryscan; private slots: - void addSearchedDevices( QList &newDevices ); + void addSearchedDevices( QList &newDevices ); void applyConfigChanges(); }; diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp index 8a7ea01..bd7d23c 100644 --- a/noncore/net/opietooth/manager/scandialog.cpp +++ b/noncore/net/opietooth/manager/scandialog.cpp @@ -124,11 +124,11 @@ namespace OpieTooth { } - void ScanDialog::fillList(const QString& device, RemoteDevices::ValueList deviceList) { + void ScanDialog::fillList(const QString& device, RemoteDevice::ValueList deviceList) { QCheckListItem * deviceItem; - RemoteDevices::ValueList::Iterator it; + RemoteDevice::ValueList::Iterator it; for( it = deviceList.begin(); it != deviceList.end(); ++it ) { deviceItem = new QCheckListItem( ListView1, (*it).name() ); @@ -146,13 +146,13 @@ namespace OpieTooth { return; } - QList *deviceList = new QList; + QList *deviceList = new QList; QListViewItemIterator it( ListView1 ); for ( ; it.current(); ++it ) { if ( ((QCheckListItem*)it.current())->isOn() ) { - RemoteDevices* device = new RemoteDevices( it.current()->text(1), it.current()->text(0)); - deviceList->append( device ); + RemoteDevice * device = new RemoteDevice( it.current()->text(1), it.current()->text(0)); + deviceList->append( device ); } } emit selectedDevices( *deviceList ); diff --git a/noncore/net/opietooth/manager/scandialog.h b/noncore/net/opietooth/manager/scandialog.h index 0ca302a..adc960c 100644 --- a/noncore/net/opietooth/manager/scandialog.h +++ b/noncore/net/opietooth/manager/scandialog.h @@ -60,7 +60,7 @@ class Device; void stopSearch(); void startSearch(); void progressTimer(); - void fillList(const QString& device, RemoteDevices::ValueList list); + void fillList(const QString& device, RemoteDevice::ValueList list); private: void emitToManager(); @@ -68,7 +68,7 @@ class Device; int progressStat; signals: - void selectedDevices(QList&); + void selectedDevices(QList&); }; -- cgit v0.9.0.2