-rw-r--r-- | noncore/net/opietooth/lib/manager.cc | 12 | ||||
-rw-r--r-- | noncore/net/opietooth/lib/manager.h | 6 | ||||
-rw-r--r-- | noncore/net/opietooth/lib/remotedevice.cc | 22 | ||||
-rw-r--r-- | noncore/net/opietooth/lib/remotedevice.h | 16 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.h | 2 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/scandialog.cpp | 3 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/scandialog.h | 4 |
7 files changed, 33 insertions, 32 deletions
diff --git a/noncore/net/opietooth/lib/manager.cc b/noncore/net/opietooth/lib/manager.cc index 40c1f0a..c454588 100644 --- a/noncore/net/opietooth/lib/manager.cc +++ b/noncore/net/opietooth/lib/manager.cc @@ -63,5 +63,5 @@ void Manager::searchDevices( const QString& device ){ if (!hcitool->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { qWarning("could not start"); - RemoteDevices::ValueList list; + RemoteDevice::ValueList list; emit foundDevices( device, list ); delete hcitool; @@ -113,5 +113,5 @@ void Manager::searchServices( const QString& remDevice ){ } } -void Manager::searchServices( const RemoteDevices& dev){ +void Manager::searchServices( const RemoteDevice& dev){ searchServices( dev.mac() ); } @@ -163,5 +163,5 @@ Services::ValueList Manager::parseSDPOutput( const QString& out ) { void Manager::slotHCIExited(OProcess* proc ) { qWarning("process exited"); - RemoteDevices::ValueList list; + RemoteDevice::ValueList list; if (proc->normalExit() ) { qWarning("normalExit %s", proc->name() ); @@ -191,7 +191,7 @@ void Manager::slotHCIOut(OProcess* proc, char* ch, int len) { m_devices.replace( proc->name(), string ); } -RemoteDevices::ValueList Manager::parseHCIOutput(const QString& output ) { +RemoteDevice::ValueList Manager::parseHCIOutput(const QString& output ) { qWarning("parseHCI %s", output.latin1() ); - RemoteDevices::ValueList list; + RemoteDevice::ValueList list; QStringList strList = QStringList::split('\n', output ); QStringList::Iterator it; @@ -206,5 +206,5 @@ RemoteDevices::ValueList Manager::parseHCIOutput(const QString& output ) { qWarning("mac %s", mac.latin1() ); qWarning("rest:%s", str.latin1() ); - RemoteDevices rem( mac , str.stripWhiteSpace() ); + RemoteDevice rem( mac , str.stripWhiteSpace() ); list.append( rem ); } diff --git a/noncore/net/opietooth/lib/manager.h b/noncore/net/opietooth/lib/manager.h index 95e4306..aba70f7 100644 --- a/noncore/net/opietooth/lib/manager.h +++ b/noncore/net/opietooth/lib/manager.h @@ -99,5 +99,5 @@ Q_OBJECT * search for services on a remote device */ - void searchServices( const RemoteDevices& ); + void searchServices( const RemoteDevice& ); /*static*/ QString toDevice( const QString& mac ); /*static*/ QString toMac( const QString &device ); @@ -110,5 +110,5 @@ Q_OBJECT void removedService( const QString& service, bool removed ); void foundServices( const QString& device, Services::ValueList ); - void foundDevices( const QString& device, RemoteDevices::ValueList ); + void foundDevices( const QString& device, RemoteDevice::ValueList ); private slots: @@ -120,5 +120,5 @@ private slots: private: Services::ValueList parseSDPOutput( const QString& ); - RemoteDevices::ValueList parseHCIOutput( const QString& ); + RemoteDevice::ValueList parseHCIOutput( const QString& ); OProcess *m_hcitool; OProcess *m_sdp; // not only one diff --git a/noncore/net/opietooth/lib/remotedevice.cc b/noncore/net/opietooth/lib/remotedevice.cc index 0045904..08fb397 100644 --- a/noncore/net/opietooth/lib/remotedevice.cc +++ b/noncore/net/opietooth/lib/remotedevice.cc @@ -4,5 +4,5 @@ using namespace OpieTooth; -bool operator==(const RemoteDevices& rem1, const RemoteDevices& rem2){ +bool operator==(const RemoteDevice& rem1, const RemoteDevice& rem2){ if( ( rem1.mac() == rem2.mac() ) && (rem1.name() == rem2.name() ) ) return true; @@ -11,23 +11,23 @@ bool operator==(const RemoteDevices& rem1, const RemoteDevices& rem2){ } -RemoteDevices::RemoteDevices(){ +RemoteDevice::RemoteDevice(){ } -RemoteDevices::RemoteDevices(const RemoteDevices& ole ){ +RemoteDevice::RemoteDevice(const RemoteDevice& ole ){ (*this) = ole; } -RemoteDevices::RemoteDevices(const QString &mac, const QString& name ){ +RemoteDevice::RemoteDevice(const QString &mac, const QString& name ){ m_mac = mac; m_name = name; } -RemoteDevices::~RemoteDevices(){ +RemoteDevice::~RemoteDevice(){ } -bool RemoteDevices::isEmpty() const { +bool RemoteDevice::isEmpty() const { if( m_name.isEmpty() && m_mac.isEmpty() ) return true; return false; }; -RemoteDevices& RemoteDevices::operator=( const RemoteDevices& rem1){ +RemoteDevice& RemoteDevice::operator=( const RemoteDevice& rem1){ m_name = rem1.m_name; m_mac = rem1.m_mac; @@ -35,14 +35,14 @@ RemoteDevices& RemoteDevices::operator=( const RemoteDevices& rem1){ } -QString RemoteDevices::mac() const { +QString RemoteDevice::mac() const { return m_mac; } -void RemoteDevices::setMac( const QString& mac ){ +void RemoteDevice::setMac( const QString& mac ){ m_mac = mac; } -QString RemoteDevices::name() const{ +QString RemoteDevice::name() const{ return m_name; } -void RemoteDevices::setName( const QString& name ){ +void RemoteDevice::setName( const QString& name ){ m_name = name; } diff --git a/noncore/net/opietooth/lib/remotedevice.h b/noncore/net/opietooth/lib/remotedevice.h index 96a27de..23f98bd 100644 --- a/noncore/net/opietooth/lib/remotedevice.h +++ b/noncore/net/opietooth/lib/remotedevice.h @@ -6,13 +6,13 @@ namespace OpieTooth{ - class RemoteDevices { + class RemoteDevice { public: - typedef QValueList<RemoteDevices> ValueList; - RemoteDevices(); - RemoteDevices(const RemoteDevices& ); - RemoteDevices(const QString &mac, const QString &name ); - ~RemoteDevices(); - friend bool operator==(const RemoteDevices&, const RemoteDevices&); - RemoteDevices &operator=(const RemoteDevices& ); + typedef QValueList<RemoteDevice> ValueList; + RemoteDevice(); + RemoteDevice(const RemoteDevice& ); + RemoteDevice(const QString &mac, const QString &name ); + ~RemoteDevice(); + friend bool operator==(const RemoteDevice&, const RemoteDevice&); + RemoteDevice &operator=(const RemoteDevice& ); bool isEmpty()const; QString mac()const; diff --git a/noncore/net/opietooth/manager/bluebase.h b/noncore/net/opietooth/manager/bluebase.h index ae5ce67..5364e51 100644 --- a/noncore/net/opietooth/manager/bluebase.h +++ b/noncore/net/opietooth/manager/bluebase.h @@ -11,4 +11,6 @@ #include "bluetoothbase.h" +#include <remotedevice.h> + class QVBox; class QHBoxLayout; diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp index 70ea77a..8a7ea01 100644 --- a/noncore/net/opietooth/manager/scandialog.cpp +++ b/noncore/net/opietooth/manager/scandialog.cpp @@ -135,5 +135,4 @@ namespace OpieTooth { deviceItem->setText(1, (*it).mac() ); } - } @@ -152,5 +151,5 @@ namespace OpieTooth { QListViewItemIterator it( ListView1 ); for ( ; it.current(); ++it ) { - if ( it.current()->isSelected() ) { + if ( ((QCheckListItem*)it.current())->isOn() ) { RemoteDevices* device = new RemoteDevices( it.current()->text(1), it.current()->text(0)); deviceList->append( device ); diff --git a/noncore/net/opietooth/manager/scandialog.h b/noncore/net/opietooth/manager/scandialog.h index 4785a62..0ca302a 100644 --- a/noncore/net/opietooth/manager/scandialog.h +++ b/noncore/net/opietooth/manager/scandialog.h @@ -22,5 +22,5 @@ #include <qlist.h> - +#include <remotedevice.h> class QVBoxLayout; class QHBoxLayout; @@ -36,5 +36,5 @@ class QProgressBar; namespace OpieTooth { -#include <remotedevices.h> + class Manager; class Device; |