author | zecke <zecke> | 2002-07-12 17:14:58 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-07-12 17:14:58 (UTC) |
commit | 89dce758480cc90502ad14b6c4cf80774e6c1845 (patch) (unidiff) | |
tree | 2ff4e635c8aa86385dfd896084f5cd419efd0840 /noncore/net/opietooth/lib | |
parent | 716211b5e06bb25145cfbcf62a11a7c52c79dde5 (diff) | |
download | opie-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
-rw-r--r-- | noncore/net/opietooth/lib/connection.cpp | 32 | ||||
-rw-r--r-- | noncore/net/opietooth/lib/connection.h | 16 | ||||
-rw-r--r-- | noncore/net/opietooth/lib/manager.cc | 10 | ||||
-rw-r--r-- | noncore/net/opietooth/lib/manager.h | 4 |
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 | |||
@@ -5,3 +5,3 @@ using namespace OpieTooth; | |||
5 | 5 | ||
6 | Connection::Connection() { | 6 | ConnectionState::ConnectionState() { |
7 | m_direction = Incoming; | 7 | m_direction = Incoming; |
@@ -12,3 +12,3 @@ Connection::Connection() { | |||
12 | 12 | ||
13 | Connection::Connection( const Connection& con1 ) { | 13 | ConnectionState::ConnectionState( const ConnectionState& con1 ) { |
14 | (*this) = con1; | 14 | (*this) = con1; |
@@ -17,3 +17,3 @@ Connection::Connection( const Connection& con1 ) { | |||
17 | 17 | ||
18 | Connection::Connection( bool in, | 18 | ConnectionState::ConnectionState( bool in, |
19 | const QString& conType, | 19 | const QString& conType, |
@@ -32,3 +32,3 @@ Connection::Connection( bool in, | |||
32 | 32 | ||
33 | void Connection::setDirection( bool incoming ) { | 33 | void ConnectionState::setDirection( bool incoming ) { |
34 | m_direction = incoming; | 34 | m_direction = incoming; |
@@ -36,3 +36,3 @@ void Connection::setDirection( bool incoming ) { | |||
36 | 36 | ||
37 | bool Connection::direction() const { | 37 | bool ConnectionState::direction() const { |
38 | return m_direction; | 38 | return m_direction; |
@@ -40,3 +40,3 @@ bool Connection::direction() const { | |||
40 | 40 | ||
41 | void Connection::setConnectionMode( const QString& conType ) { | 41 | void ConnectionState::setConnectionMode( const QString& conType ) { |
42 | m_contype = conType; | 42 | m_contype = conType; |
@@ -44,3 +44,3 @@ void Connection::setConnectionMode( const QString& conType ) { | |||
44 | 44 | ||
45 | QString Connection::connectionMode() const { | 45 | QString ConnectionState::connectionMode() const { |
46 | return m_contype; | 46 | return m_contype; |
@@ -48,3 +48,3 @@ QString Connection::connectionMode() const { | |||
48 | 48 | ||
49 | void Connection::setMac( const QString& mac ) { | 49 | void ConnectionState::setMac( const QString& mac ) { |
50 | m_mac = mac; | 50 | m_mac = mac; |
@@ -52,3 +52,3 @@ void Connection::setMac( const QString& mac ) { | |||
52 | 52 | ||
53 | QString Connection::mac() const{ | 53 | QString ConnectionState::mac() const{ |
54 | return m_mac; | 54 | return m_mac; |
@@ -56,3 +56,3 @@ QString Connection::mac() const{ | |||
56 | 56 | ||
57 | void Connection::setHandle( int handle ) { | 57 | void ConnectionState::setHandle( int handle ) { |
58 | m_handle = handle; | 58 | m_handle = handle; |
@@ -60,3 +60,3 @@ void Connection::setHandle( int handle ) { | |||
60 | 60 | ||
61 | int Connection::handle() const{ | 61 | int ConnectionState::handle() const{ |
62 | return m_handle; | 62 | return m_handle; |
@@ -64,3 +64,3 @@ int Connection::handle() const{ | |||
64 | 64 | ||
65 | void Connection::setState( int state ) { | 65 | void ConnectionState::setState( int state ) { |
66 | m_state = state; | 66 | m_state = state; |
@@ -68,3 +68,3 @@ void Connection::setState( int state ) { | |||
68 | 68 | ||
69 | int Connection::state()const { | 69 | int ConnectionState::state()const { |
70 | return m_state; | 70 | return m_state; |
@@ -72,3 +72,3 @@ int Connection::state()const { | |||
72 | 72 | ||
73 | void Connection::setLinkMode( int linkMode ) { | 73 | void ConnectionState::setLinkMode( int linkMode ) { |
74 | m_linkMode = linkMode; | 74 | m_linkMode = linkMode; |
@@ -76,3 +76,3 @@ void Connection::setLinkMode( int linkMode ) { | |||
76 | 76 | ||
77 | int Connection::linkMode()const{ | 77 | int ConnectionState::linkMode()const{ |
78 | return m_linkMode; | 78 | return m_linkMode; |
@@ -80,3 +80,3 @@ int Connection::linkMode()const{ | |||
80 | 80 | ||
81 | Connection &Connection::operator=( const Connection& con1 ) { | 81 | ConnectionState &ConnectionState::operator=( const ConnectionState& con1 ) { |
82 | m_direction = con1.m_direction; | 82 | m_direction = con1.m_direction; |
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 | |||
@@ -19,3 +19,3 @@ namespace OpieTooth { | |||
19 | 19 | ||
20 | class Connection { | 20 | class ConnectionState { |
21 | public: | 21 | public: |
@@ -25,3 +25,3 @@ namespace OpieTooth { | |||
25 | */ | 25 | */ |
26 | typedef QValueList<Connection> ValueList; | 26 | typedef QValueList<ConnectionState> ValueList; |
27 | 27 | ||
@@ -30,3 +30,3 @@ namespace OpieTooth { | |||
30 | */ | 30 | */ |
31 | Connection( const Connection& ); | 31 | ConnectionState( const ConnectionState& ); |
32 | 32 | ||
@@ -46,3 +46,3 @@ namespace OpieTooth { | |||
46 | */ | 46 | */ |
47 | Connection( bool in, | 47 | ConnectionState( bool in, |
48 | const QString& conType, | 48 | const QString& conType, |
@@ -57,3 +57,3 @@ namespace OpieTooth { | |||
57 | */ | 57 | */ |
58 | Connection(); | 58 | ConnectionState(); |
59 | 59 | ||
@@ -133,7 +133,7 @@ namespace OpieTooth { | |||
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; |
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 | |||
@@ -256,3 +256,3 @@ void Manager::searchConnections() { | |||
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 ); |
@@ -263,3 +263,3 @@ void 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 ); |
@@ -272,4 +272,4 @@ void Manager::slotConnectionOutput(OProcess* proc, char* cha, int len) { | |||
272 | } | 272 | } |
273 | Connection::ValueList Manager::parseConnections( const QString& out ) { | 273 | ConnectionState::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 ); |
@@ -288,3 +288,3 @@ Connection::ValueList Manager::parseConnections( const QString& out ) { | |||
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 ); |
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 | |||
@@ -139,3 +139,3 @@ namespace OpieTooth { | |||
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 | ||
@@ -155,3 +155,3 @@ private slots: | |||
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; |