author | zecke <zecke> | 2002-07-08 18:46:40 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-07-08 18:46:40 (UTC) |
commit | 7d82c654e6a1df83f70b2d81aa05a1175799b66b (patch) (unidiff) | |
tree | 079e87ac4dcd96c304a4e8eb7f928194fffe63f1 | |
parent | 35d0ca5cc59b82af7b7ddb343ec092c3171b11ef (diff) | |
download | opie-7d82c654e6a1df83f70b2d81aa05a1175799b66b.zip opie-7d82c654e6a1df83f70b2d81aa05a1175799b66b.tar.gz opie-7d82c654e6a1df83f70b2d81aa05a1175799b66b.tar.bz2 |
API clean ups
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 7 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/btlistitem.cpp | 22 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/btlistitem.h | 16 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/hciconfwrapper.cpp | 4 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/hciconfwrapper.h | 4 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/main.cpp | 4 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/scandialog.cpp | 10 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/scandialog.h | 2 |
8 files changed, 31 insertions, 38 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index ff6981b..8ddc161 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp | |||
@@ -427,19 +427,20 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
427 | deviceItem->setPixmap( 1, m_offPix ); | 427 | deviceItem->setPixmap( 1, m_offPix ); |
428 | } | 428 | } |
429 | } | 429 | } |
430 | 430 | ||
431 | /** | 431 | /** |
432 | * Open the "scan for devices" dialog | 432 | * Open the "scan for devices" dialog |
433 | */ | 433 | */ |
434 | void BlueBase::startScan() { | 434 | void BlueBase::startScan() { |
435 | ScanDialog *scan = new ScanDialog( this, "", true); | 435 | ScanDialog *scan = new ScanDialog( this, "ScanDialog", |
436 | QObject::connect( scan, SIGNAL( selectedDevices( QList<RemoteDevice>& ) ), | 436 | true, WDestructiveClose ); |
437 | this, SLOT( addSearchedDevices( QList<RemoteDevice>& ) ) ); | 437 | QObject::connect( scan, SIGNAL( selectedDevices( QValueList<RemoteDevice>& ) ), |
438 | this, SLOT( addSearchedDevices( QValueList<RemoteDevice>& ) ) ); | ||
438 | 439 | ||
439 | scan->showMaximized(); | 440 | scan->showMaximized(); |
440 | } | 441 | } |
441 | 442 | ||
442 | 443 | ||
443 | /** | 444 | /** |
444 | * Set the informations about the local device in information Tab | 445 | * Set the informations about the local device in information Tab |
445 | */ | 446 | */ |
diff --git a/noncore/net/opietooth/manager/btlistitem.cpp b/noncore/net/opietooth/manager/btlistitem.cpp index ce5b141..82e7c00 100644 --- a/noncore/net/opietooth/manager/btlistitem.cpp +++ b/noncore/net/opietooth/manager/btlistitem.cpp | |||
@@ -1,67 +1,61 @@ | |||
1 | 1 | ||
2 | #include "btlistitem.h" | 2 | #include "btlistitem.h" |
3 | 3 | ||
4 | namespace OpieTooth { | 4 | namespace OpieTooth { |
5 | 5 | ||
6 | 6 | ||
7 | BTListItem::BTListItem( QListView * parent ) : QListViewItem( parent ) { | 7 | BTListItem::BTListItem( QListView * parent ) : QListViewItem( parent ) { |
8 | m_name = ""; | ||
9 | m_mac =""; | ||
10 | m_type =""; | ||
11 | } | 8 | } |
12 | 9 | ||
13 | BTListItem::BTListItem( QListViewItem * parent ) : QListViewItem( parent ) { | 10 | BTListItem::BTListItem( QListViewItem * parent ) : QListViewItem( parent ) { |
14 | m_name = ""; | ||
15 | m_mac =""; | ||
16 | m_type =""; | ||
17 | } | 11 | } |
18 | 12 | ||
19 | 13 | ||
20 | // name, and then mac and then servicetype | 14 | // name, and then mac and then servicetype |
21 | BTListItem::BTListItem( QListView * parent, QString name , QString mac, QString type ) | 15 | BTListItem::BTListItem( QListView * parent, const QString &name , const QString& mac, const QString& type ) |
22 | : QListViewItem( parent, name ){ | 16 | : QListViewItem( parent, name ){ |
23 | 17 | ||
24 | m_name = name; | 18 | m_name = name; |
25 | m_mac = mac; | 19 | m_mac = mac; |
26 | m_type = type; | 20 | m_type = type; |
27 | 21 | ||
28 | } | 22 | } |
29 | 23 | ||
30 | BTListItem::BTListItem( QListViewItem * parent , QString name, QString mac, QString type ) | 24 | BTListItem::BTListItem( QListViewItem * parent , const QString& name, const QString& mac, const QString& type ) |
31 | : QListViewItem( parent, name ){ | 25 | : QListViewItem( parent, name ){ |
32 | 26 | ||
33 | m_name = name; | 27 | m_name = name; |
34 | m_mac = mac; | 28 | m_mac = mac; |
35 | m_type = type; | 29 | m_type = type; |
36 | } | 30 | } |
37 | 31 | ||
38 | 32 | ||
39 | void BTListItem::setMac( QString mac ) { | 33 | void BTListItem::setMac( const QString& mac ) { |
40 | m_mac = mac; | 34 | m_mac = mac; |
41 | } | 35 | } |
42 | 36 | ||
43 | QString BTListItem::mac() { | 37 | QString BTListItem::mac() const { |
44 | return m_mac; | 38 | return m_mac; |
45 | } | 39 | } |
46 | 40 | ||
47 | void BTListItem::setName( QString name ) { | 41 | void BTListItem::setName( const QString& name ) { |
48 | m_name = name; | 42 | m_name = name; |
49 | } | 43 | } |
50 | 44 | ||
51 | QString BTListItem::name() { | 45 | QString BTListItem::name() const { |
52 | return m_name; | 46 | return m_name; |
53 | } | 47 | } |
54 | 48 | ||
55 | void BTListItem::setType( QString type ) { | 49 | void BTListItem::setType( const QString& type ) { |
56 | m_type = type; | 50 | m_type = type; |
57 | } | 51 | } |
58 | 52 | ||
59 | QString BTListItem::type() { | 53 | QString BTListItem::type() const { |
60 | return m_type; | 54 | return m_type; |
61 | } | 55 | } |
62 | 56 | ||
63 | 57 | ||
64 | BTListItem::~BTListItem() { | 58 | BTListItem::~BTListItem() { |
65 | } | 59 | } |
66 | 60 | ||
67 | }; | 61 | }; |
diff --git a/noncore/net/opietooth/manager/btlistitem.h b/noncore/net/opietooth/manager/btlistitem.h index 8963caa..d7ce03b 100644 --- a/noncore/net/opietooth/manager/btlistitem.h +++ b/noncore/net/opietooth/manager/btlistitem.h | |||
@@ -7,26 +7,26 @@ namespace OpieTooth { | |||
7 | 7 | ||
8 | class BTListItem : public QListViewItem { | 8 | class BTListItem : public QListViewItem { |
9 | 9 | ||
10 | public: | 10 | public: |
11 | BTListItem( QListView * parent ); | 11 | BTListItem( QListView * parent ); |
12 | BTListItem( QListViewItem * parent ); | 12 | BTListItem( QListViewItem * parent ); |
13 | 13 | ||
14 | // name, and then mac and then servicetype | 14 | // name, and then mac and then servicetype |
15 | BTListItem( QListView * , QString, QString, QString ); | 15 | BTListItem( QListView * , const QString&, const QString&, const QString& ); |
16 | BTListItem( QListViewItem * parent , QString, QString , QString ); | 16 | BTListItem( QListViewItem * parent , const QString&, const QString& , const QString& ); |
17 | ~BTListItem(); | 17 | ~BTListItem(); |
18 | 18 | ||
19 | void setMac( QString ); | 19 | void setMac( const QString& ); |
20 | QString mac(); | 20 | QString mac()const; |
21 | void setName( QString ); | 21 | void setName( const QString& ); |
22 | QString name(); | 22 | QString name()const; |
23 | void setType( QString ); | 23 | void setType( const QString& ); |
24 | QString type(); | 24 | QString type()const; |
25 | private: | 25 | private: |
26 | QString m_name; | 26 | QString m_name; |
27 | QString m_mac; | 27 | QString m_mac; |
28 | QString m_type; | 28 | QString m_type; |
29 | 29 | ||
30 | }; | 30 | }; |
31 | }; | 31 | }; |
32 | 32 | ||
diff --git a/noncore/net/opietooth/manager/hciconfwrapper.cpp b/noncore/net/opietooth/manager/hciconfwrapper.cpp index 0b90e87..5f74fee 100644 --- a/noncore/net/opietooth/manager/hciconfwrapper.cpp +++ b/noncore/net/opietooth/manager/hciconfwrapper.cpp | |||
@@ -11,21 +11,21 @@ namespace OpieTooth { | |||
11 | HciConfWrapper::HciConfWrapper( const QString &fileName) { | 11 | HciConfWrapper::HciConfWrapper( const QString &fileName) { |
12 | m_fileName = fileName; | 12 | m_fileName = fileName; |
13 | } | 13 | } |
14 | 14 | ||
15 | HciConfWrapper::~HciConfWrapper() { | 15 | HciConfWrapper::~HciConfWrapper() { |
16 | } | 16 | } |
17 | 17 | ||
18 | 18 | ||
19 | void HciConfWrapper::setPinHelper( QString app ) { | 19 | void HciConfWrapper::setPinHelper( const QString& app ) { |
20 | setValue( "pin_helper" , app ); | 20 | setValue( "pin_helper" , app ); |
21 | } | 21 | } |
22 | 22 | ||
23 | void HciConfWrapper::setName( QString name ) { | 23 | void HciConfWrapper::setName( const QString &name ) { |
24 | qDebug ("NAME : " + name); | 24 | qDebug ("NAME : " + name); |
25 | setValue( "name" , "\"" + name + "\"" ); | 25 | setValue( "name" , "\"" + name + "\"" ); |
26 | } | 26 | } |
27 | 27 | ||
28 | void HciConfWrapper::setIscan( bool enable) { | 28 | void HciConfWrapper::setIscan( bool enable) { |
29 | 29 | ||
30 | if ( enable ) { | 30 | if ( enable ) { |
31 | setValue( "iscan" , "enable" ); | 31 | setValue( "iscan" , "enable" ); |
diff --git a/noncore/net/opietooth/manager/hciconfwrapper.h b/noncore/net/opietooth/manager/hciconfwrapper.h index 10738c0..de8c9a8 100644 --- a/noncore/net/opietooth/manager/hciconfwrapper.h +++ b/noncore/net/opietooth/manager/hciconfwrapper.h | |||
@@ -6,18 +6,18 @@ | |||
6 | namespace OpieTooth { | 6 | namespace OpieTooth { |
7 | 7 | ||
8 | class HciConfWrapper { | 8 | class HciConfWrapper { |
9 | 9 | ||
10 | public: | 10 | public: |
11 | HciConfWrapper( const QString &fileName ); | 11 | HciConfWrapper( const QString &fileName ); |
12 | ~HciConfWrapper(); | 12 | ~HciConfWrapper(); |
13 | 13 | ||
14 | void setPinHelper( QString app ); | 14 | void setPinHelper( const QString& app ); |
15 | void setName( QString name ); | 15 | void setName( const QString& name ); |
16 | void setIscan( bool enable ); | 16 | void setIscan( bool enable ); |
17 | void setPscan( bool enable ); | 17 | void setPscan( bool enable ); |
18 | void setAuth( bool enable); | 18 | void setAuth( bool enable); |
19 | void setEncrypt( bool enable); | 19 | void setEncrypt( bool enable); |
20 | 20 | ||
21 | private: | 21 | private: |
22 | 22 | ||
23 | void setValue(const QString &entry, const QString &value ); | 23 | void setValue(const QString &entry, const QString &value ); |
diff --git a/noncore/net/opietooth/manager/main.cpp b/noncore/net/opietooth/manager/main.cpp index d60ef1c..a86e36d 100644 --- a/noncore/net/opietooth/manager/main.cpp +++ b/noncore/net/opietooth/manager/main.cpp | |||
@@ -22,17 +22,17 @@ | |||
22 | 22 | ||
23 | 23 | ||
24 | QPEApplication *BluetoothApp; | 24 | QPEApplication *BluetoothApp; |
25 | 25 | ||
26 | int main( int argc, char ** argv ) { | 26 | int main( int argc, char ** argv ) { |
27 | QPEApplication a(argc, argv); | 27 | QPEApplication a(argc, argv); |
28 | BluetoothApp=&a; | 28 | BluetoothApp=&a; |
29 | 29 | ||
30 | OpieTooth::BlueBase *t = new OpieTooth::BlueBase(); | 30 | OpieTooth::BlueBase t; |
31 | 31 | ||
32 | // t.setCaption( OpieTooth::BlueBase::tr("Bluetooth Manager") ); | 32 | // t.setCaption( OpieTooth::BlueBase::tr("Bluetooth Manager") ); |
33 | a.showMainWidget(t); | 33 | a.showMainWidget(&t); |
34 | 34 | ||
35 | return a.exec(); | 35 | return a.exec(); |
36 | } | 36 | } |
37 | 37 | ||
38 | 38 | ||
diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp index 0e6e93b..3d6c928 100644 --- a/noncore/net/opietooth/manager/scandialog.cpp +++ b/noncore/net/opietooth/manager/scandialog.cpp | |||
@@ -153,29 +153,27 @@ namespace OpieTooth { | |||
153 | */ | 153 | */ |
154 | void ScanDialog::emitToManager() { | 154 | void ScanDialog::emitToManager() { |
155 | qDebug("vor liste durchsuchen"); | 155 | qDebug("vor liste durchsuchen"); |
156 | 156 | ||
157 | if (!ListView1) { | 157 | if (!ListView1) { |
158 | return; | 158 | return; |
159 | } | 159 | } |
160 | 160 | ||
161 | QList<RemoteDevice> *deviceList = new QList<RemoteDevice>; | 161 | QValueList<RemoteDevice> deviceList; |
162 | deviceList->setAutoDelete(true); | ||
163 | 162 | ||
164 | QListViewItemIterator it( ListView1 ); | 163 | QListViewItemIterator it( ListView1 ); |
165 | for ( ; it.current(); ++it ) { | 164 | for ( ; it.current(); ++it ) { |
166 | if ( ((QCheckListItem*)it.current())->isOn() ) { | 165 | if ( ((QCheckListItem*)it.current())->isOn() ) { |
167 | RemoteDevice * device = new RemoteDevice( it.current()->text(1), it.current()->text(0)); | 166 | RemoteDevice device( it.current()->text(1), it.current()->text(0)); |
168 | deviceList->append( device ); | 167 | deviceList.append( device ); |
169 | } | 168 | } |
170 | } | 169 | } |
171 | qDebug("vor emit"); | 170 | qDebug("vor emit"); |
172 | emit selectedDevices( *deviceList ); | 171 | emit selectedDevices( deviceList ); |
173 | delete deviceList; | ||
174 | } | 172 | } |
175 | 173 | ||
176 | /* | 174 | /* |
177 | * Cleanup | 175 | * Cleanup |
178 | */ | 176 | */ |
179 | ScanDialog::~ScanDialog() { | 177 | ScanDialog::~ScanDialog() { |
180 | delete localDevice; | 178 | delete localDevice; |
181 | } | 179 | } |
diff --git a/noncore/net/opietooth/manager/scandialog.h b/noncore/net/opietooth/manager/scandialog.h index 7c84ce2..cc890f3 100644 --- a/noncore/net/opietooth/manager/scandialog.h +++ b/noncore/net/opietooth/manager/scandialog.h | |||
@@ -65,15 +65,15 @@ public slots: | |||
65 | void fillList(const QString& device, RemoteDevice::ValueList list); | 65 | void fillList(const QString& device, RemoteDevice::ValueList list); |
66 | 66 | ||
67 | private: | 67 | private: |
68 | void emitToManager(); | 68 | void emitToManager(); |
69 | Manager *localDevice; | 69 | Manager *localDevice; |
70 | int progressStat; | 70 | int progressStat; |
71 | 71 | ||
72 | signals: | 72 | signals: |
73 | void selectedDevices(QList<RemoteDevice>&); | 73 | void selectedDevices(QValueList<RemoteDevice>&); |
74 | }; | 74 | }; |
75 | 75 | ||
76 | 76 | ||
77 | } | 77 | } |
78 | 78 | ||
79 | #endif // SCANDIALOG_H | 79 | #endif // SCANDIALOG_H |