summaryrefslogtreecommitdiff
path: root/noncore
authorzecke <zecke>2002-07-12 17:14:58 (UTC)
committer zecke <zecke>2002-07-12 17:14:58 (UTC)
commit89dce758480cc90502ad14b6c4cf80774e6c1845 (patch) (unidiff)
tree2ff4e635c8aa86385dfd896084f5cd419efd0840 /noncore
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') (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
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp84
-rw-r--r--noncore/net/opietooth/manager/bluebase.h11
-rw-r--r--noncore/net/opietooth/manager/btlistitem.cpp60
-rw-r--r--noncore/net/opietooth/manager/btlistitem.h21
-rw-r--r--noncore/net/opietooth/manager/manager.pro4
-rw-r--r--noncore/net/opietooth/manager/popuphelper.cpp9
-rw-r--r--noncore/net/opietooth/manager/popuphelper.h6
11 files changed, 109 insertions, 148 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
6Connection::Connection() { 6ConnectionState::ConnectionState() {
7 m_direction = Incoming; 7 m_direction = Incoming;
@@ -12,3 +12,3 @@ Connection::Connection() {
12 12
13Connection::Connection( const Connection& con1 ) { 13ConnectionState::ConnectionState( const ConnectionState& con1 ) {
14 (*this) = con1; 14 (*this) = con1;
@@ -17,3 +17,3 @@ Connection::Connection( const Connection& con1 ) {
17 17
18Connection::Connection( bool in, 18ConnectionState::ConnectionState( bool in,
19 const QString& conType, 19 const QString& conType,
@@ -32,3 +32,3 @@ Connection::Connection( bool in,
32 32
33void Connection::setDirection( bool incoming ) { 33void ConnectionState::setDirection( bool incoming ) {
34 m_direction = incoming; 34 m_direction = incoming;
@@ -36,3 +36,3 @@ void Connection::setDirection( bool incoming ) {
36 36
37bool Connection::direction() const { 37bool ConnectionState::direction() const {
38 return m_direction; 38 return m_direction;
@@ -40,3 +40,3 @@ bool Connection::direction() const {
40 40
41void Connection::setConnectionMode( const QString& conType ) { 41void 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
45QString Connection::connectionMode() const { 45QString ConnectionState::connectionMode() const {
46 return m_contype; 46 return m_contype;
@@ -48,3 +48,3 @@ QString Connection::connectionMode() const {
48 48
49void Connection::setMac( const QString& mac ) { 49void 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
53QString Connection::mac() const{ 53QString ConnectionState::mac() const{
54 return m_mac; 54 return m_mac;
@@ -56,3 +56,3 @@ QString Connection::mac() const{
56 56
57void Connection::setHandle( int handle ) { 57void ConnectionState::setHandle( int handle ) {
58 m_handle = handle; 58 m_handle = handle;
@@ -60,3 +60,3 @@ void Connection::setHandle( int handle ) {
60 60
61int Connection::handle() const{ 61int ConnectionState::handle() const{
62 return m_handle; 62 return m_handle;
@@ -64,3 +64,3 @@ int Connection::handle() const{
64 64
65void Connection::setState( int state ) { 65void ConnectionState::setState( int state ) {
66 m_state = state; 66 m_state = state;
@@ -68,3 +68,3 @@ void Connection::setState( int state ) {
68 68
69int Connection::state()const { 69int ConnectionState::state()const {
70 return m_state; 70 return m_state;
@@ -72,3 +72,3 @@ int Connection::state()const {
72 72
73void Connection::setLinkMode( int linkMode ) { 73void ConnectionState::setLinkMode( int linkMode ) {
74 m_linkMode = linkMode; 74 m_linkMode = linkMode;
@@ -76,3 +76,3 @@ void Connection::setLinkMode( int linkMode ) {
76 76
77int Connection::linkMode()const{ 77int ConnectionState::linkMode()const{
78 return m_linkMode; 78 return m_linkMode;
@@ -80,3 +80,3 @@ int Connection::linkMode()const{
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;
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}
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 );
@@ -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;
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 85c6717..9cfeaa2 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -46,2 +46,4 @@
46 46
47#include "btconnectionitem.h"
48
47using namespace OpieTooth; 49using namespace OpieTooth;
@@ -89,6 +91,9 @@ using namespace OpieTooth;
89 91
90 BTListItem *topLV2 = new BTListItem( ListView2, "Siemens S45", "", "device" ); 92 BTDeviceItem *topLV2 = new BTDeviceItem( ListView2, RemoteDevice("xx:", "Siemens S45" ) );
91 topLV2->setPixmap( 1, m_onPix ); 93 topLV2->setPixmap( 1, m_onPix );
92 (void) new BTListItem( topLV2, "Serial" ,"", "service" ); 94 Services s1;
93 (void) new BTListItem( topLV2, "BlueNiC" , "", "service" ); 95 s1.setServiceName( "Serial" );
96 (void) new BTServiceItem( topLV2, s1 );
97 s1.setServiceName( "BlueNic" );
98 (void) new BTServiceItem( topLV2, s1 );
94 99
@@ -186,9 +191,15 @@ using namespace OpieTooth;
186 QListViewItemIterator it( ListView2 ); 191 QListViewItemIterator it( ListView2 );
192 BTListItem* item;
193 BTDeviceItem* device;
187 194
188 for ( ; it.current(); ++it ) { 195 for ( ; it.current(); ++it ) {
196 item = (BTListItem*)it.current();
197 if(item->typeId() != BTListItem::Device )
198 continue;
199 device = (BTDeviceItem*)item;
189 // seperate config file for each device, to store more information in future. 200 // seperate config file for each device, to store more information in future.
190 qDebug( "/Settings/bluetooth/" + (((BTListItem*)it.current())->mac()) + ".conf"); 201 qDebug( "/Settings/bluetooth/" + device->mac() + ".conf");
191 Config conf( QDir::homeDirPath() + "/Settings/bluetooth/" + (((BTListItem*)it.current())->mac()) + ".conf", Config::File ); 202 Config conf( QDir::homeDirPath() + "/Settings/bluetooth/" + device->mac() + ".conf", Config::File );
192 conf.setGroup( "Info" ); 203 conf.setGroup( "Info" );
193 conf.writeEntry( "name", ((BTListItem*)it.current())->name() ); 204 conf.writeEntry( "name", device->name() );
194 } 205 }
@@ -247,3 +258,3 @@ using namespace OpieTooth;
247 void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices ) { 258 void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices ) {
248 BTListItem * deviceItem; 259 BTDeviceItem * deviceItem;
249 QValueList<RemoteDevice>::ConstIterator it; 260 QValueList<RemoteDevice>::ConstIterator it;
@@ -251,3 +262,4 @@ using namespace OpieTooth;
251 for( it = newDevices.begin(); it != newDevices.end() ; ++it ) { 262 for( it = newDevices.begin(); it != newDevices.end() ; ++it ) {
252 deviceItem = new BTListItem( ListView2 , (*it).name(), (*it).mac(), "device" ); 263
264 deviceItem = new BTDeviceItem( ListView2 , (*it) );
253 deviceItem->setExpandable ( true ); 265 deviceItem->setExpandable ( true );
@@ -328,6 +340,6 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
328 */ 340 */
329 void BlueBase::addServicesToDevice( BTListItem * item ) { 341 void BlueBase::addServicesToDevice( BTDeviceItem * item ) {
330 qDebug("addServicesToDevice"); 342 qDebug("addServicesToDevice");
331 // row of mac adress text(3) 343 // row of mac adress text(3)
332 RemoteDevice device( item->mac(), item->name() ); 344 RemoteDevice device = item->remoteDevice();
333 m_deviceList.insert( item->mac() , item ); 345 m_deviceList.insert( item->mac() , item );
@@ -346,14 +358,13 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
346 358
347 QMap<QString,BTListItem*>::Iterator it; 359 QMap<QString,BTDeviceItem*>::Iterator it;
348 BTListItem* deviceItem = 0; 360 BTDeviceItem* deviceItem = 0;
349 361
350 // get the right devices which requested the search 362 // get the right devices which requested the search
351 for( it = m_deviceList.begin(); it != m_deviceList.end(); ++it ) { 363 it = m_deviceList.find( device );
352 if ( it.key() == device ) { 364 if( it == m_deviceList.end() )
353 deviceItem = it.data(); 365 return;
354 } 366 deviceItem = it.data();
355 }
356 367
357 QValueList<OpieTooth::Services>::Iterator it2; 368 QValueList<OpieTooth::Services>::Iterator it2;
358 BTListItem * serviceItem; 369 BTServiceItem * serviceItem;
359 370
@@ -362,3 +373,3 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
362 for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 ) { 373 for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 ) {
363 serviceItem = new BTListItem( deviceItem , (*it2).serviceName() , "" , "service" ); 374 serviceItem = new BTServiceItem( deviceItem , (*it2) );
364 serviceItem->setPixmap( 0, m_iconLoader->serviceIcon( (*it2).classIdList() ) ); 375 serviceItem->setPixmap( 0, m_iconLoader->serviceIcon( (*it2).classIdList() ) );
@@ -366,4 +377,8 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
366 } else { 377 } else {
367 serviceItem = new BTListItem( deviceItem , tr("no services found"), "" , "service" ); 378 Services s1;
379 s1.setServiceName( tr("no serives found") );
380 serviceItem = new BTServiceItem( deviceItem, s1 );
368 } 381 }
382 // now remove them from the list
383 m_deviceList.remove( it );
369 } 384 }
@@ -380,5 +395,5 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
380 395
381 void BlueBase::addConnectedDevices( Connection::ValueList connectionList ) { 396 void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) {
382 QValueList<OpieTooth::Connection>::Iterator it; 397 QValueList<OpieTooth::ConnectionState>::Iterator it;
383 BTListItem * connectionItem; 398 BTConnectionItem * connectionItem;
384 399
@@ -387,6 +402,8 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
387 for (it = connectionList.begin(); it != connectionList.end(); ++it) { 402 for (it = connectionList.begin(); it != connectionList.end(); ++it) {
388 connectionItem = new BTListItem( ListView4 , (*it).mac() , (*it).mac() , "connection" ); 403 connectionItem = new BTConnectionItem( ListView4 , (*it) );
389 } 404 }
390 } else { 405 } else {
391 connectionItem = new BTListItem( ListView4 , tr("No connections found"), "", "connection" ); 406 ConnectionState con;
407 con.setMac( tr("No connections found") );
408 connectionItem = new BTConnectionItem( ListView4 , con );
392 } 409 }
@@ -402,2 +419,3 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
402 // search by mac, async, gets a signal back 419 // search by mac, async, gets a signal back
420 // We should have a BTDeviceItem there or where does it get added to the map -zecke
403 m_localDevice->isAvailable( device.mac() ); 421 m_localDevice->isAvailable( device.mac() );
@@ -413,11 +431,10 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
413 431
414 QMap<QString,BTListItem*>::Iterator it; 432 QMap<QString,BTDeviceItem*>::Iterator it;
415 BTListItem* deviceItem = 0; 433
434 it = m_deviceList.find( device );
435 if( it == m_deviceList.end() )
436 return;
437
438 BTDeviceItem* deviceItem = it.data();
416 439
417 // get the right devices which requested the search
418 for( it = m_deviceList.begin(); it != m_deviceList.end(); ++it ) {
419 if ( it.key() == device ) {
420 deviceItem = it.data();
421 }
422 }
423 440
@@ -428,2 +445,3 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
428 } 445 }
446 m_deviceList.remove( it );
429 } 447 }
diff --git a/noncore/net/opietooth/manager/bluebase.h b/noncore/net/opietooth/manager/bluebase.h
index 73fac97..a8f4fe4 100644
--- a/noncore/net/opietooth/manager/bluebase.h
+++ b/noncore/net/opietooth/manager/bluebase.h
@@ -12,3 +12,6 @@
12#include "bluetoothbase.h" 12#include "bluetoothbase.h"
13#include "btlistitem.h" 13
14#include "btserviceitem.h"
15#include "btdeviceitem.h"
16
14#include "bticonloader.h" 17#include "bticonloader.h"
@@ -53,3 +56,3 @@ namespace OpieTooth {
53 Manager *m_localDevice; 56 Manager *m_localDevice;
54 QMap<QString,BTListItem*> m_deviceList; 57 QMap<QString,BTDeviceItem*> m_deviceList;
55 58
@@ -71,6 +74,6 @@ namespace OpieTooth {
71 void addSearchedDevices( const QValueList<RemoteDevice> &newDevices ); 74 void addSearchedDevices( const QValueList<RemoteDevice> &newDevices );
72 void addServicesToDevice( BTListItem *item ); 75 void addServicesToDevice( BTDeviceItem *item );
73 void addServicesToDevice( const QString& device, Services::ValueList ); 76 void addServicesToDevice( const QString& device, Services::ValueList );
74 void addConnectedDevices(); 77 void addConnectedDevices();
75 void addConnectedDevices( Connection::ValueList ); 78 void addConnectedDevices( ConnectionState::ValueList );
76 void startServiceActionClicked( QListViewItem *item ); 79 void startServiceActionClicked( QListViewItem *item );
diff --git a/noncore/net/opietooth/manager/btlistitem.cpp b/noncore/net/opietooth/manager/btlistitem.cpp
index 82e7c00..36816f8 100644
--- a/noncore/net/opietooth/manager/btlistitem.cpp
+++ b/noncore/net/opietooth/manager/btlistitem.cpp
@@ -3,59 +3,9 @@
3 3
4namespace OpieTooth { 4using namespace OpieTooth;
5 5
6 6
7 BTListItem::BTListItem( QListView * parent ) : QListViewItem( parent ) { 7BTListItem::BTListItem( QListView * parent ) : QListViewItem( parent ) {
8 } 8}
9 9
10 BTListItem::BTListItem( QListViewItem * parent ) : QListViewItem( parent ) { 10BTListItem::BTListItem( QListViewItem * parent ) : QListViewItem( parent ) {
11 } 11}
12
13
14 // name, and then mac and then servicetype
15 BTListItem::BTListItem( QListView * parent, const QString &name , const QString& mac, const QString& type )
16 : QListViewItem( parent, name ){
17
18 m_name = name;
19 m_mac = mac;
20 m_type = type;
21
22 }
23
24 BTListItem::BTListItem( QListViewItem * parent , const QString& name, const QString& mac, const QString& type )
25 : QListViewItem( parent, name ){
26
27 m_name = name;
28 m_mac = mac;
29 m_type = type;
30 }
31
32
33 void BTListItem::setMac( const QString& mac ) {
34 m_mac = mac;
35 }
36
37 QString BTListItem::mac() const {
38 return m_mac;
39 }
40
41 void BTListItem::setName( const QString& name ) {
42 m_name = name;
43 }
44
45 QString BTListItem::name() const {
46 return m_name;
47 }
48
49 void BTListItem::setType( const QString& type ) {
50 m_type = type;
51 }
52
53 QString BTListItem::type() const {
54 return m_type;
55 }
56
57
58 BTListItem::~BTListItem() {
59 }
60
61};
diff --git a/noncore/net/opietooth/manager/btlistitem.h b/noncore/net/opietooth/manager/btlistitem.h
index d7ce03b..6b529d1 100644
--- a/noncore/net/opietooth/manager/btlistitem.h
+++ b/noncore/net/opietooth/manager/btlistitem.h
@@ -8,23 +8,8 @@ namespace OpieTooth {
8 class BTListItem : public QListViewItem { 8 class BTListItem : public QListViewItem {
9
10 public: 9 public:
10 enum Types { Device =0, Service, Connection };
11 BTListItem( QListView * parent ); 11 BTListItem( QListView * parent );
12 BTListItem( QListViewItem * parent ); 12 BTListItem( QListViewItem * parent );
13 13 virtual QString type() const = 0;
14 // name, and then mac and then servicetype 14 virtual int typeId() const = 0;
15 BTListItem( QListView * , const QString&, const QString&, const QString& );
16 BTListItem( QListViewItem * parent , const QString&, const QString& , const QString& );
17 ~BTListItem();
18
19 void setMac( const QString& );
20 QString mac()const;
21 void setName( const QString& );
22 QString name()const;
23 void setType( const QString& );
24 QString type()const;
25 private:
26 QString m_name;
27 QString m_mac;
28 QString m_type;
29
30 }; 15 };
diff --git a/noncore/net/opietooth/manager/manager.pro b/noncore/net/opietooth/manager/manager.pro
index 4f0ea60..d36b8df2 100644
--- a/noncore/net/opietooth/manager/manager.pro
+++ b/noncore/net/opietooth/manager/manager.pro
@@ -3,4 +3,4 @@ CONFIG = qt warn_on debug
3#CONFIG = qt warn_on release 3#CONFIG = qt warn_on release
4HEADERS = popuphelper.h bluebase.h scandialog.h btlistitem.h hciconfwrapper.h bticonloader.h 4HEADERS = btconnectionitem.h btdeviceitem.h btserviceitem.h stdpopups.h popuphelper.h bluebase.h scandialog.h btlistitem.h hciconfwrapper.h bticonloader.h
5SOURCES = popuphelper.cpp main.cpp bluebase.cpp scandialog.cpp btlistitem.cpp hciconfwrapper.cpp bticonloader.cpp 5SOURCES = btconnectionitem.cpp btdeviceitem.cpp btserviceitem.h stdpopups.cpp popuphelper.cpp main.cpp bluebase.cpp scandialog.cpp btlistitem.cpp hciconfwrapper.cpp bticonloader.cpp
6INCLUDEPATH += $(OPIEDIR)/include 6INCLUDEPATH += $(OPIEDIR)/include
diff --git a/noncore/net/opietooth/manager/popuphelper.cpp b/noncore/net/opietooth/manager/popuphelper.cpp
index 2a6dad0..d8404d6 100644
--- a/noncore/net/opietooth/manager/popuphelper.cpp
+++ b/noncore/net/opietooth/manager/popuphelper.cpp
@@ -1,2 +1,4 @@
1 1
2#include "stdpopups.h"
3
2#include "popuphelper.h" 4#include "popuphelper.h"
@@ -14,3 +16,3 @@ void PopupHelper::insert( int id, popupFactory fact ) {
14} 16}
15QPopupMenu* PopupHelper::find( int id ) { 17QPopupMenu* PopupHelper::find( int id, const Services& ser, QListViewItem* item ) {
16 FactoryMap::Iterator it = m_map.find(id ); 18 FactoryMap::Iterator it = m_map.find(id );
@@ -18,3 +20,3 @@ QPopupMenu* PopupHelper::find( int id ) {
18 popupFactory fact = it.data(); 20 popupFactory fact = it.data();
19 return (*fact)(); 21 return (*fact)(ser, item);
20 } 22 }
@@ -23,3 +25,4 @@ QPopupMenu* PopupHelper::find( int id ) {
23void PopupHelper::init() { 25void PopupHelper::init() {
24 26 insert( 1, newRfcComPopup );
27 insert(2, newObexPushPopup );
25} 28}
diff --git a/noncore/net/opietooth/manager/popuphelper.h b/noncore/net/opietooth/manager/popuphelper.h
index 7485f71..7541ac5 100644
--- a/noncore/net/opietooth/manager/popuphelper.h
+++ b/noncore/net/opietooth/manager/popuphelper.h
@@ -4,2 +4,3 @@
4 4
5#include <qlistview.h>
5#include <qpopupmenu.h> 6#include <qpopupmenu.h>
@@ -7,5 +8,6 @@
7 8
9#include <services.h>
8 10
9namespace OpieTooth { 11namespace OpieTooth {
10 typedef QPopupMenu* (*popupFactory)(void); 12 typedef QPopupMenu* (*popupFactory)(const Services&, QListViewItem*);
11 typedef QMap<int, popupFactory> FactoryMap; 13 typedef QMap<int, popupFactory> FactoryMap;
@@ -16,3 +18,3 @@ namespace OpieTooth {
16 void insert( int id, popupFactory fact ); 18 void insert( int id, popupFactory fact );
17 QPopupMenu* find( int id ); 19 QPopupMenu* find( int id, const Services&, QListViewItem* );
18 private: 20 private: