summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/lib
authorzecke <zecke>2002-07-12 17:14:58 (UTC)
committer zecke <zecke>2002-07-12 17:14:58 (UTC)
commit89dce758480cc90502ad14b6c4cf80774e6c1845 (patch) (unidiff)
tree2ff4e635c8aa86385dfd896084f5cd419efd0840 /noncore/net/opietooth/lib
parent716211b5e06bb25145cfbcf62a11a7c52c79dde5 (diff)
downloadopie-89dce758480cc90502ad14b6c4cf80774e6c1845.zip
opie-89dce758480cc90502ad14b6c4cf80774e6c1845.tar.gz
opie-89dce758480cc90502ad14b6c4cf80774e6c1845.tar.bz2
- Connection -> ConnectionState
- Factory adjustments - Factory function - Refactoring the QListViewItem derived class BTListItem | - BTDeviceItem for RemoteDevices | - BTServiceItem for Services | - BTConnectionItem for ConnectionState - misc bug fixes
Diffstat (limited to 'noncore/net/opietooth/lib') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/lib/connection.cpp32
-rw-r--r--noncore/net/opietooth/lib/connection.h16
-rw-r--r--noncore/net/opietooth/lib/manager.cc10
-rw-r--r--noncore/net/opietooth/lib/manager.h4
4 files changed, 31 insertions, 31 deletions
diff --git a/noncore/net/opietooth/lib/connection.cpp b/noncore/net/opietooth/lib/connection.cpp
index 1f9baaf..ef7d925 100644
--- a/noncore/net/opietooth/lib/connection.cpp
+++ b/noncore/net/opietooth/lib/connection.cpp
@@ -4,5 +4,5 @@
4using namespace OpieTooth; 4using namespace OpieTooth;
5 5
6Connection::Connection() { 6ConnectionState::ConnectionState() {
7 m_direction = Incoming; 7 m_direction = Incoming;
8 m_handle = -1; 8 m_handle = -1;
@@ -11,10 +11,10 @@ Connection::Connection() {
11}; 11};
12 12
13Connection::Connection( const Connection& con1 ) { 13ConnectionState::ConnectionState( const ConnectionState& con1 ) {
14 (*this) = con1; 14 (*this) = con1;
15} 15}
16 16
17 17
18Connection::Connection( bool in, 18ConnectionState::ConnectionState( bool in,
19 const QString& conType, 19 const QString& conType,
20 const QString& mac, 20 const QString& mac,
@@ -31,53 +31,53 @@ Connection::Connection( bool in,
31} 31}
32 32
33void Connection::setDirection( bool incoming ) { 33void ConnectionState::setDirection( bool incoming ) {
34 m_direction = incoming; 34 m_direction = incoming;
35} 35}
36 36
37bool Connection::direction() const { 37bool ConnectionState::direction() const {
38 return m_direction; 38 return m_direction;
39} 39}
40 40
41void Connection::setConnectionMode( const QString& conType ) { 41void ConnectionState::setConnectionMode( const QString& conType ) {
42 m_contype = conType; 42 m_contype = conType;
43} 43}
44 44
45QString Connection::connectionMode() const { 45QString ConnectionState::connectionMode() const {
46 return m_contype; 46 return m_contype;
47} 47}
48 48
49void Connection::setMac( const QString& mac ) { 49void ConnectionState::setMac( const QString& mac ) {
50 m_mac = mac; 50 m_mac = mac;
51} 51}
52 52
53QString Connection::mac() const{ 53QString ConnectionState::mac() const{
54 return m_mac; 54 return m_mac;
55} 55}
56 56
57void Connection::setHandle( int handle ) { 57void ConnectionState::setHandle( int handle ) {
58 m_handle = handle; 58 m_handle = handle;
59} 59}
60 60
61int Connection::handle() const{ 61int ConnectionState::handle() const{
62 return m_handle; 62 return m_handle;
63} 63}
64 64
65void Connection::setState( int state ) { 65void ConnectionState::setState( int state ) {
66 m_state = state; 66 m_state = state;
67} 67}
68 68
69int Connection::state()const { 69int ConnectionState::state()const {
70 return m_state; 70 return m_state;
71} 71}
72 72
73void Connection::setLinkMode( int linkMode ) { 73void ConnectionState::setLinkMode( int linkMode ) {
74 m_linkMode = linkMode; 74 m_linkMode = linkMode;
75} 75}
76 76
77int Connection::linkMode()const{ 77int ConnectionState::linkMode()const{
78 return m_linkMode; 78 return m_linkMode;
79} 79}
80 80
81Connection &Connection::operator=( const Connection& con1 ) { 81ConnectionState &ConnectionState::operator=( const ConnectionState& con1 ) {
82 m_direction = con1.m_direction; 82 m_direction = con1.m_direction;
83 m_contype = con1.m_contype; 83 m_contype = con1.m_contype;
diff --git a/noncore/net/opietooth/lib/connection.h b/noncore/net/opietooth/lib/connection.h
index 37090ce..76e5dad 100644
--- a/noncore/net/opietooth/lib/connection.h
+++ b/noncore/net/opietooth/lib/connection.h
@@ -18,5 +18,5 @@ namespace OpieTooth {
18 */ 18 */
19 19
20 class Connection { 20 class ConnectionState {
21 public: 21 public:
22 /** 22 /**
@@ -24,10 +24,10 @@ namespace OpieTooth {
24 * Connections 24 * Connections
25 */ 25 */
26 typedef QValueList<Connection> ValueList; 26 typedef QValueList<ConnectionState> ValueList;
27 27
28 /** 28 /**
29 * Copy c'tor. 29 * Copy c'tor.
30 */ 30 */
31 Connection( const Connection& ); 31 ConnectionState( const ConnectionState& );
32 32
33 /** 33 /**
@@ -45,5 +45,5 @@ namespace OpieTooth {
45 * 45 *
46 */ 46 */
47 Connection( bool in, 47 ConnectionState( bool in,
48 const QString& conType, 48 const QString& conType,
49 const QString& mac, 49 const QString& mac,
@@ -56,5 +56,5 @@ namespace OpieTooth {
56 * QValueList needs this c'tor. 56 * QValueList needs this c'tor.
57 */ 57 */
58 Connection(); 58 ConnectionState();
59 59
60 /** 60 /**
@@ -132,9 +132,9 @@ namespace OpieTooth {
132 * copy c'tor 132 * copy c'tor
133 */ 133 */
134 Connection &operator=( const Connection& ); 134 ConnectionState &operator=( const ConnectionState& );
135 135
136 private: 136 private:
137 class ConnectionPrivate; 137 class ConnectionStatePrivate;
138 ConnectionPrivate *d; 138 ConnectionStatePrivate *d;
139 bool m_direction : 1; 139 bool m_direction : 1;
140 QString m_contype; 140 QString m_contype;
diff --git a/noncore/net/opietooth/lib/manager.cc b/noncore/net/opietooth/lib/manager.cc
index e07f9da..1281116 100644
--- a/noncore/net/opietooth/lib/manager.cc
+++ b/noncore/net/opietooth/lib/manager.cc
@@ -255,5 +255,5 @@ void Manager::searchConnections() {
255 255
256 if (!proc->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 256 if (!proc->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
257 Connection::ValueList list; 257 ConnectionState::ValueList list;
258 emit connections( list ); 258 emit connections( list );
259 delete proc; 259 delete proc;
@@ -262,5 +262,5 @@ void Manager::searchConnections() {
262void Manager::slotConnectionExited( OProcess* /*proc*/ ) { 262void Manager::slotConnectionExited( OProcess* /*proc*/ ) {
263 qWarning("exited"); 263 qWarning("exited");
264 Connection::ValueList list; 264 ConnectionState::ValueList list;
265 list = parseConnections( m_hcitoolCon ); 265 list = parseConnections( m_hcitoolCon );
266 emit connections(list ); 266 emit connections(list );
@@ -271,6 +271,6 @@ void Manager::slotConnectionOutput(OProcess* proc, char* cha, int len) {
271 delete proc; 271 delete proc;
272} 272}
273Connection::ValueList Manager::parseConnections( const QString& out ) { 273ConnectionState::ValueList Manager::parseConnections( const QString& out ) {
274 Connection::ValueList list2; 274 ConnectionState::ValueList list2;
275 QStringList list = QStringList::split('\n', out ); 275 QStringList list = QStringList::split('\n', out );
276 QStringList::Iterator it; 276 QStringList::Iterator it;
@@ -287,5 +287,5 @@ Connection::ValueList Manager::parseConnections( const QString& out ) {
287 qWarning("7: %s", value[7].latin1() ); 287 qWarning("7: %s", value[7].latin1() );
288 qWarning("8: %s", value[8].latin1() ); 288 qWarning("8: %s", value[8].latin1() );
289 Connection con; 289 ConnectionState con;
290 con.setDirection( value[0] == QString::fromLatin1("<") ? Outgoing : Incoming ); 290 con.setDirection( value[0] == QString::fromLatin1("<") ? Outgoing : Incoming );
291 con.setConnectionMode( value[1] ); 291 con.setConnectionMode( value[1] );
diff --git a/noncore/net/opietooth/lib/manager.h b/noncore/net/opietooth/lib/manager.h
index b32327c..0ebe1b3 100644
--- a/noncore/net/opietooth/lib/manager.h
+++ b/noncore/net/opietooth/lib/manager.h
@@ -138,5 +138,5 @@ namespace OpieTooth {
138 void foundServices( const QString& device, Services::ValueList ); 138 void foundServices( const QString& device, Services::ValueList );
139 void foundDevices( const QString& device, RemoteDevice::ValueList ); 139 void foundDevices( const QString& device, RemoteDevice::ValueList );
140 void connections( Connection::ValueList ); 140 void connections( ConnectionState::ValueList );
141 141
142private slots: 142private slots:
@@ -154,5 +154,5 @@ private slots:
154 Services::ValueList parseSDPOutput( const QString& ); 154 Services::ValueList parseSDPOutput( const QString& );
155 RemoteDevice::ValueList parseHCIOutput( const QString& ); 155 RemoteDevice::ValueList parseHCIOutput( const QString& );
156 Connection::ValueList parseConnections( const QString& ); 156 ConnectionState::ValueList parseConnections( const QString& );
157 OProcess *m_hcitool; 157 OProcess *m_hcitool;
158 OProcess *m_sdp; // not only one 158 OProcess *m_sdp; // not only one