summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth
authormickeyl <mickeyl>2004-04-04 13:54:40 (UTC)
committer mickeyl <mickeyl>2004-04-04 13:54:40 (UTC)
commit16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (unidiff)
tree0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/net/opietooth
parent8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff)
downloadopie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip
opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz
opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2
convert to Opie Debugging Framework
Diffstat (limited to 'noncore/net/opietooth') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/applet/bluezapplet.cpp2
-rw-r--r--noncore/net/opietooth/lib/startdunconnection.cpp2
-rw-r--r--noncore/net/opietooth/lib/startpanconnection.cpp8
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp16
-rw-r--r--noncore/net/opietooth/manager/devicehandler.cpp10
-rw-r--r--noncore/net/opietooth/manager/dunpopup.cpp2
-rw-r--r--noncore/net/opietooth/manager/hciconfwrapper.cpp16
-rw-r--r--noncore/net/opietooth/manager/obexdialog.cpp2
-rw-r--r--noncore/net/opietooth/manager/obexpopup.cpp4
-rw-r--r--noncore/net/opietooth/manager/panpopup.cpp2
-rw-r--r--noncore/net/opietooth/manager/popuphelper.cpp4
-rw-r--r--noncore/net/opietooth/manager/pppdialog.cpp2
-rw-r--r--noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp4
-rw-r--r--noncore/net/opietooth/manager/rfcommconfhandler.cpp10
-rw-r--r--noncore/net/opietooth/manager/rfcpopup.cpp8
-rw-r--r--noncore/net/opietooth/manager/scandialog.cpp2
16 files changed, 47 insertions, 47 deletions
diff --git a/noncore/net/opietooth/applet/bluezapplet.cpp b/noncore/net/opietooth/applet/bluezapplet.cpp
index 8a7f0bc..1d93f5c 100644
--- a/noncore/net/opietooth/applet/bluezapplet.cpp
+++ b/noncore/net/opietooth/applet/bluezapplet.cpp
@@ -161,61 +161,61 @@ namespace OpieTooth {
161 break; 161 break;
162 case 3: 162 case 3:
163 setBluezDiscoveryStatus(0); 163 setBluezDiscoveryStatus(0);
164 timerEvent( 0 ); 164 timerEvent( 0 );
165 break; 165 break;
166 case 4: 166 case 4:
167 setBluezDiscoveryStatus(1); 167 setBluezDiscoveryStatus(1);
168 timerEvent(0 ); 168 timerEvent(0 );
169 break; 169 break;
170 //case 7: 170 //case 7:
171 // With table of currently-detected devices. 171 // With table of currently-detected devices.
172 } 172 }
173 173
174 delete signal; 174 delete signal;
175 delete menu; 175 delete menu;
176 } 176 }
177 177
178 178
179/** 179/**
180 * Launches the bluetooth manager 180 * Launches the bluetooth manager
181 */ 181 */
182 void BluezApplet::launchManager() { 182 void BluezApplet::launchManager() {
183 QCopEnvelope e("QPE/System", "execute(QString)"); 183 QCopEnvelope e("QPE/System", "execute(QString)");
184 e << QString("bluetooth-manager"); 184 e << QString("bluetooth-manager");
185 } 185 }
186 186
187/** 187/**
188 * Refresh timer 188 * Refresh timer
189 * @param the timer event 189 * @param the timer event
190 */ 190 */
191 void BluezApplet::timerEvent( QTimerEvent * ) { 191 void BluezApplet::timerEvent( QTimerEvent * ) {
192 bool oldactive = bluezactive; 192 bool oldactive = bluezactive;
193 int olddiscovery = bluezDiscoveryActive; 193 int olddiscovery = bluezDiscoveryActive;
194 194
195 bluezactive = checkBluezStatus(); 195 bluezactive = checkBluezStatus();
196 bluezDiscoveryActive = checkBluezDiscoveryStatus(); 196 bluezDiscoveryActive = checkBluezDiscoveryStatus();
197 197
198 if ((bluezactive != oldactive) || (bluezDiscoveryActive != olddiscovery)) { 198 if ((bluezactive != oldactive) || (bluezDiscoveryActive != olddiscovery)) {
199 update(); 199 update();
200 } 200 }
201 } 201 }
202 202
203/** 203/**
204 * Implementation of the paint event 204 * Implementation of the paint event
205 * @param the QPaintEvent 205 * @param the QPaintEvent
206 */ 206 */
207 void BluezApplet::paintEvent( QPaintEvent* ) { 207 void BluezApplet::paintEvent( QPaintEvent* ) {
208 QPainter p(this); 208 QPainter p(this);
209 qDebug("paint bluetooth pixmap"); 209 odebug << "paint bluetooth pixmap" << oendl;
210 210
211 if (bluezactive > 0) { 211 if (bluezactive > 0) {
212 p.drawPixmap( 0, 1, bluezOnPixmap ); 212 p.drawPixmap( 0, 1, bluezOnPixmap );
213 } else { 213 } else {
214 p.drawPixmap( 0, 1, bluezOffPixmap ); 214 p.drawPixmap( 0, 1, bluezOffPixmap );
215 } 215 }
216 216
217 if (bluezDiscoveryActive > 0) { 217 if (bluezDiscoveryActive > 0) {
218 p.drawPixmap( 0, 1, bluezDiscoveryOnPixmap ); 218 p.drawPixmap( 0, 1, bluezDiscoveryOnPixmap );
219 } 219 }
220 } 220 }
221}; 221};
diff --git a/noncore/net/opietooth/lib/startdunconnection.cpp b/noncore/net/opietooth/lib/startdunconnection.cpp
index 09b19d2..37f2ae7 100644
--- a/noncore/net/opietooth/lib/startdunconnection.cpp
+++ b/noncore/net/opietooth/lib/startdunconnection.cpp
@@ -1,68 +1,68 @@
1 1
2#include "startdunconnection.h" 2#include "startdunconnection.h"
3 3
4using namespace OpieTooth; 4using namespace OpieTooth;
5 5
6 6
7using namespace Opie::Core; 7using namespace Opie::Core;
8StartDunConnection::StartDunConnection() { 8StartDunConnection::StartDunConnection() {
9 m_dunConnect = 0l; 9 m_dunConnect = 0l;
10 setConnectionType(); 10 setConnectionType();
11} 11}
12 12
13StartDunConnection::~StartDunConnection() { 13StartDunConnection::~StartDunConnection() {
14 delete m_dunConnect; 14 delete m_dunConnect;
15} 15}
16 16
17StartDunConnection::StartDunConnection( QString mac ) { 17StartDunConnection::StartDunConnection( QString mac ) {
18 m_dunConnect = 0l; 18 m_dunConnect = 0l;
19 m_mac = mac; 19 m_mac = mac;
20 setConnectionType(); 20 setConnectionType();
21} 21}
22 22
23void StartDunConnection::setName( QString name ) { 23void StartDunConnection::setName( QString name ) {
24 m_name = name; 24 m_name = name;
25} 25}
26 26
27QString StartDunConnection::name() { 27QString StartDunConnection::name() {
28 return m_name; 28 return m_name;
29} 29}
30 30
31void StartDunConnection::setConnectionType() { 31void StartDunConnection::setConnectionType() {
32 m_connectionType = Pan; 32 m_connectionType = Pan;
33} 33}
34 34
35StartConnection::ConnectionType StartDunConnection::type() { 35StartConnection::ConnectionType StartDunConnection::type() {
36 return m_connectionType; 36 return m_connectionType;
37} 37}
38 38
39void StartDunConnection::start() { 39void StartDunConnection::start() {
40 m_dunConnect = new OProcess(); 40 m_dunConnect = new OProcess();
41 *m_dunConnect << "dund" << "--listen" << "--connect" << m_mac; 41 *m_dunConnect << "dund" << "--listen" << "--connect" << m_mac;
42 42
43 connect( m_dunConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) , 43 connect( m_dunConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) ,
44 this, SLOT( slotExited(Opie::Core::OProcess*) ) ); 44 this, SLOT( slotExited(Opie::Core::OProcess*) ) );
45 connect( m_dunConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ), 45 connect( m_dunConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ),
46 this, SLOT( slotStdOut(Opie::Core::OProcess*,char*,int) ) ); 46 this, SLOT( slotStdOut(Opie::Core::OProcess*,char*,int) ) );
47 if (!m_dunConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { 47 if (!m_dunConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
48 qWarning( "could not start" ); 48 owarn << "could not start" << oendl;
49 delete m_dunConnect; 49 delete m_dunConnect;
50 } 50 }
51} 51}
52 52
53 53
54void StartDunConnection::slotExited( OProcess* proc ) { 54void StartDunConnection::slotExited( OProcess* proc ) {
55 delete m_dunConnect; 55 delete m_dunConnect;
56} 56}
57 57
58void StartDunConnection::slotStdOut(OProcess* proc, char* chars, int len) 58void StartDunConnection::slotStdOut(OProcess* proc, char* chars, int len)
59{} 59{}
60 60
61 61
62void StartDunConnection::stop() { 62void StartDunConnection::stop() {
63 if ( m_dunConnect ) { 63 if ( m_dunConnect ) {
64 delete m_dunConnect; 64 delete m_dunConnect;
65 m_dunConnect = 0l; 65 m_dunConnect = 0l;
66 } 66 }
67} 67}
68 68
diff --git a/noncore/net/opietooth/lib/startpanconnection.cpp b/noncore/net/opietooth/lib/startpanconnection.cpp
index 24ac530..50afc9f 100644
--- a/noncore/net/opietooth/lib/startpanconnection.cpp
+++ b/noncore/net/opietooth/lib/startpanconnection.cpp
@@ -1,84 +1,84 @@
1 1
2#include "startpanconnection.h" 2#include "startpanconnection.h"
3 3
4using namespace OpieTooth; 4using namespace OpieTooth;
5 5
6 6
7using namespace Opie::Core; 7using namespace Opie::Core;
8using namespace Opie::Core; 8using namespace Opie::Core;
9StartPanConnection::StartPanConnection() { 9StartPanConnection::StartPanConnection() {
10 m_panConnect = 0l; 10 m_panConnect = 0l;
11 setConnectionType(); 11 setConnectionType();
12} 12}
13 13
14StartPanConnection::~StartPanConnection() { 14StartPanConnection::~StartPanConnection() {
15 delete m_panConnect; 15 delete m_panConnect;
16} 16}
17 17
18StartPanConnection::StartPanConnection( QString mac ) { 18StartPanConnection::StartPanConnection( QString mac ) {
19 m_panConnect = 0l; 19 m_panConnect = 0l;
20 m_mac = mac; 20 m_mac = mac;
21 setConnectionType(); 21 setConnectionType();
22} 22}
23 23
24void StartPanConnection::setName( QString name ) { 24void StartPanConnection::setName( QString name ) {
25 m_name = name; 25 m_name = name;
26} 26}
27 27
28QString StartPanConnection::name() { 28QString StartPanConnection::name() {
29 return m_name; 29 return m_name;
30} 30}
31 31
32void StartPanConnection::setConnectionType() { 32void StartPanConnection::setConnectionType() {
33 m_connectionType = Pan; 33 m_connectionType = Pan;
34} 34}
35 35
36StartConnection::ConnectionType StartPanConnection::type() { 36StartConnection::ConnectionType StartPanConnection::type() {
37 return m_connectionType; 37 return m_connectionType;
38} 38}
39 39
40void StartPanConnection::start() { 40void StartPanConnection::start() {
41 m_panConnect = new OProcess(); 41 m_panConnect = new OProcess();
42 qDebug( "IM START " + m_mac ); 42 odebug << "IM START " + m_mac << oendl;
43 *m_panConnect << "pand" << "--connect" << m_mac; 43 *m_panConnect << "pand" << "--connect" << m_mac;
44 44
45 connect( m_panConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) , 45 connect( m_panConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) ,
46 this, SLOT( slotExited(Opie::Core::OProcess*) ) ); 46 this, SLOT( slotExited(Opie::Core::OProcess*) ) );
47 connect( m_panConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ), 47 connect( m_panConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ),
48 this, SLOT( slotStdOut(Opie::Core::OProcess*,char*,int) ) ); 48 this, SLOT( slotStdOut(Opie::Core::OProcess*,char*,int) ) );
49 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { 49 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
50 qWarning( "could not start" ); 50 owarn << "could not start" << oendl;
51 delete m_panConnect; 51 delete m_panConnect;
52 } 52 }
53} 53}
54 54
55 55
56void StartPanConnection::slotExited( OProcess* proc ) { 56void StartPanConnection::slotExited( OProcess* proc ) {
57 delete m_panConnect; 57 delete m_panConnect;
58 m_panConnect = 0l; 58 m_panConnect = 0l;
59} 59}
60 60
61void StartPanConnection::slotStdOut(OProcess* proc, char* chars, int len) 61void StartPanConnection::slotStdOut(OProcess* proc, char* chars, int len)
62{} 62{}
63 63
64 64
65void StartPanConnection::stop() { 65void StartPanConnection::stop() {
66 if ( m_panConnect ) { 66 if ( m_panConnect ) {
67 delete m_panConnect; 67 delete m_panConnect;
68 m_panConnect = 0l; 68 m_panConnect = 0l;
69 } 69 }
70 m_panConnect = new OProcess(); 70 m_panConnect = new OProcess();
71 qDebug("IM STOP " + m_mac); 71 odebug << "IM STOP " + m_mac << oendl;
72 72
73 *m_panConnect << "pand" << "--kill" << m_mac; 73 *m_panConnect << "pand" << "--kill" << m_mac;
74 74
75 connect( m_panConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) , 75 connect( m_panConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) ,
76 this, SLOT( slotExited(Opie::Core::OProcess*) ) ); 76 this, SLOT( slotExited(Opie::Core::OProcess*) ) );
77 connect( m_panConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ), 77 connect( m_panConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ),
78 this, SLOT( slotStdOut(Opie::Core::OProcess*,char*,int) ) ); 78 this, SLOT( slotStdOut(Opie::Core::OProcess*,char*,int) ) );
79 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { 79 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
80 qWarning( "could not stop" ); 80 owarn << "could not stop" << oendl;
81 delete m_panConnect; 81 delete m_panConnect;
82 } 82 }
83} 83}
84 84
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 29030ab..b1cddd2 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -110,97 +110,97 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
110 // search conncetions 110 // search conncetions
111 addConnectedDevices(); 111 addConnectedDevices();
112 addSignalStrength(); 112 addSignalStrength();
113 m_iconLoader = new BTIconLoader(); 113 m_iconLoader = new BTIconLoader();
114 readSavedDevices(); 114 readSavedDevices();
115} 115}
116 116
117/** 117/**
118 * Reads all options from the config file 118 * Reads all options from the config file
119 */ 119 */
120void BlueBase::readConfig() 120void BlueBase::readConfig()
121{ 121{
122 122
123 Config cfg( "bluetoothmanager" ); 123 Config cfg( "bluetoothmanager" );
124 cfg.setGroup( "bluezsettings" ); 124 cfg.setGroup( "bluezsettings" );
125 125
126 m_deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with 126 m_deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with
127 m_defaultPasskey = cfg.readEntryCrypt( "passkey" , "" ); // <- hmm, look up how good the trolls did that, maybe too weak 127 m_defaultPasskey = cfg.readEntryCrypt( "passkey" , "" ); // <- hmm, look up how good the trolls did that, maybe too weak
128 m_useEncryption = cfg.readBoolEntry( "useEncryption" , TRUE ); 128 m_useEncryption = cfg.readBoolEntry( "useEncryption" , TRUE );
129 m_enableAuthentification = cfg.readBoolEntry( "enableAuthentification" , TRUE ); 129 m_enableAuthentification = cfg.readBoolEntry( "enableAuthentification" , TRUE );
130 m_enablePagescan = cfg.readBoolEntry( "enablePagescan" , TRUE ); 130 m_enablePagescan = cfg.readBoolEntry( "enablePagescan" , TRUE );
131 m_enableInquiryscan = cfg.readBoolEntry( "enableInquiryscan" , TRUE ); 131 m_enableInquiryscan = cfg.readBoolEntry( "enableInquiryscan" , TRUE );
132} 132}
133 133
134/** 134/**
135 * Writes all options to the config file 135 * Writes all options to the config file
136 */ 136 */
137void BlueBase::writeConfig() 137void BlueBase::writeConfig()
138{ 138{
139 139
140 Config cfg( "bluetoothmanager" ); 140 Config cfg( "bluetoothmanager" );
141 cfg.setGroup( "bluezsettings" ); 141 cfg.setGroup( "bluezsettings" );
142 142
143 cfg.writeEntry( "name" , m_deviceName ); 143 cfg.writeEntry( "name" , m_deviceName );
144 cfg.writeEntryCrypt( "passkey" , m_defaultPasskey ); 144 cfg.writeEntryCrypt( "passkey" , m_defaultPasskey );
145 cfg.writeEntry( "useEncryption" , m_useEncryption ); 145 cfg.writeEntry( "useEncryption" , m_useEncryption );
146 cfg.writeEntry( "enableAuthentification" , m_enableAuthentification ); 146 cfg.writeEntry( "enableAuthentification" , m_enableAuthentification );
147 cfg.writeEntry( "enablePagescan" , m_enablePagescan ); 147 cfg.writeEntry( "enablePagescan" , m_enablePagescan );
148 cfg.writeEntry( "enableInquiryscan" , m_enableInquiryscan ); 148 cfg.writeEntry( "enableInquiryscan" , m_enableInquiryscan );
149 149
150 writeToHciConfig(); 150 writeToHciConfig();
151} 151}
152 152
153/** 153/**
154 * Modify the hcid.conf file to our needs 154 * Modify the hcid.conf file to our needs
155 */ 155 */
156void BlueBase::writeToHciConfig() 156void BlueBase::writeToHciConfig()
157{ 157{
158 qWarning("writeToHciConfig"); 158 owarn << "writeToHciConfig" << oendl;
159 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" ); 159 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" );
160 hciconf.load(); 160 hciconf.load();
161 hciconf.setPinHelper( "/opt/QtPalmtop/bin/bluepin" ); 161 hciconf.setPinHelper( "/opt/QtPalmtop/bin/bluepin" );
162 hciconf.setName( m_deviceName ); 162 hciconf.setName( m_deviceName );
163 hciconf.setEncrypt( m_useEncryption ); 163 hciconf.setEncrypt( m_useEncryption );
164 hciconf.setAuth( m_enableAuthentification ); 164 hciconf.setAuth( m_enableAuthentification );
165 hciconf.setPscan( m_enablePagescan ); 165 hciconf.setPscan( m_enablePagescan );
166 hciconf.setIscan( m_enableInquiryscan ); 166 hciconf.setIscan( m_enableInquiryscan );
167 hciconf.save(); 167 hciconf.save();
168} 168}
169 169
170 170
171/** 171/**
172 * Read the list of allready known devices 172 * Read the list of allready known devices
173 */ 173 */
174void BlueBase::readSavedDevices() 174void BlueBase::readSavedDevices()
175{ 175{
176 176
177 QValueList<RemoteDevice> loadedDevices; 177 QValueList<RemoteDevice> loadedDevices;
178 DeviceHandler handler; 178 DeviceHandler handler;
179 loadedDevices = handler.load(); 179 loadedDevices = handler.load();
180 180
181 addSearchedDevices( loadedDevices ); 181 addSearchedDevices( loadedDevices );
182} 182}
183 183
184 184
185/** 185/**
186 * Write the list of allready known devices 186 * Write the list of allready known devices
187 */ 187 */
188void BlueBase::writeSavedDevices() 188void BlueBase::writeSavedDevices()
189{ 189{
190 QListViewItemIterator it( ListView2 ); 190 QListViewItemIterator it( ListView2 );
191 BTListItem* item; 191 BTListItem* item;
192 BTDeviceItem* device; 192 BTDeviceItem* device;
193 RemoteDevice::ValueList list; 193 RemoteDevice::ValueList list;
194 for ( ; it.current(); ++it ) 194 for ( ; it.current(); ++it )
195 { 195 {
196 item = (BTListItem*)it.current(); 196 item = (BTListItem*)it.current();
197 if(item->typeId() != BTListItem::Device ) 197 if(item->typeId() != BTListItem::Device )
198 continue; 198 continue;
199 device = (BTDeviceItem*)item; 199 device = (BTDeviceItem*)item;
200 200
201 list.append( device->remoteDevice() ); 201 list.append( device->remoteDevice() );
202 } 202 }
203 /* 203 /*
204 * if not empty save the List through DeviceHandler 204 * if not empty save the List through DeviceHandler
205 */ 205 */
206 if ( list.isEmpty() ) 206 if ( list.isEmpty() )
@@ -322,153 +322,153 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
322 { 322 {
323 323
324 QPopupMenu *groups = new QPopupMenu(); 324 QPopupMenu *groups = new QPopupMenu();
325 325
326 menu->insertItem( ((BTDeviceItem*)item)->name(),0 ); 326 menu->insertItem( ((BTDeviceItem*)item)->name(),0 );
327 menu->insertSeparator(1); 327 menu->insertSeparator(1);
328 menu->insertItem( tr("rescan sevices"), 2); 328 menu->insertItem( tr("rescan sevices"), 2);
329 menu->insertItem( tr("to group"), groups , 3); 329 menu->insertItem( tr("to group"), groups , 3);
330 menu->insertItem( tr("delete"), 4); 330 menu->insertItem( tr("delete"), 4);
331 331
332 ret = menu->exec( point , 0); 332 ret = menu->exec( point , 0);
333 333
334 switch(ret) 334 switch(ret)
335 { 335 {
336 case -1: 336 case -1:
337 break; 337 break;
338 case 2: 338 case 2:
339 addServicesToDevice( (BTDeviceItem*)item ); 339 addServicesToDevice( (BTDeviceItem*)item );
340 break; 340 break;
341 341
342 case 4: 342 case 4:
343 // deletes childs too 343 // deletes childs too
344 delete item; 344 delete item;
345 break; 345 break;
346 } 346 }
347 delete groups; 347 delete groups;
348 348
349 } 349 }
350 350
351 /* 351 /*
352 * We got service sensitive PopupMenus in our factory 352 * We got service sensitive PopupMenus in our factory
353 * We will create one through the factory and will insert 353 * We will create one through the factory and will insert
354 * our Separator + ShowInfo into the menu or create a new 354 * our Separator + ShowInfo into the menu or create a new
355 * one if the factory returns 0 355 * one if the factory returns 0
356 * PopupMenu deletion is kind of weird. 356 * PopupMenu deletion is kind of weird.
357 * If escaped( -1 ) or any of our items were chosen we'll 357 * If escaped( -1 ) or any of our items were chosen we'll
358 * delete the PopupMenu otherwise it's the responsibility of 358 * delete the PopupMenu otherwise it's the responsibility of
359 * the PopupMenu to delete itself 359 * the PopupMenu to delete itself
360 * 360 *
361 */ 361 */
362 else if ( ((BTListItem*)item)->type() == "service") 362 else if ( ((BTListItem*)item)->type() == "service")
363 { 363 {
364 BTServiceItem* service = (BTServiceItem*)item; 364 BTServiceItem* service = (BTServiceItem*)item;
365 QMap<int, QString> list = service->services().classIdList(); 365 QMap<int, QString> list = service->services().classIdList();
366 QMap<int, QString>::Iterator it = list.begin(); 366 QMap<int, QString>::Iterator it = list.begin();
367 QPopupMenu *popup =0l; 367 QPopupMenu *popup =0l;
368 if ( it != list.end() ) 368 if ( it != list.end() )
369 { 369 {
370 qWarning("Searching id %d %s", it.key(), it.data().latin1() ); 370 owarn << "Searching id " << it.key() << " " << it.data().latin1() << "" << oendl;
371 popup = m_popHelper.find( it.key(), 371 popup = m_popHelper.find( it.key(),
372 service->services(), 372 service->services(),
373 (BTDeviceItem*)service->parent() ); 373 (BTDeviceItem*)service->parent() );
374 } 374 }
375 else 375 else
376 { 376 {
377 qWarning("Empty"); 377 owarn << "Empty" << oendl;
378 } 378 }
379 379
380 if ( popup == 0l ) 380 if ( popup == 0l )
381 { 381 {
382 qWarning("factory returned 0l"); 382 owarn << "factory returned 0l" << oendl;
383 popup = new QPopupMenu(); 383 popup = new QPopupMenu();
384 } 384 }
385 int test1 = popup->insertItem( tr("Test1:"), 2); 385 int test1 = popup->insertItem( tr("Test1:"), 2);
386 386
387 ret = popup->exec( point ); 387 ret = popup->exec( point );
388 qWarning("returned from exec() "); 388 owarn << "returned from exec() " << oendl;
389 if ( ret == -1 ) 389 if ( ret == -1 )
390 { 390 {
391 ; 391 ;
392 } 392 }
393 else if ( ret == test1 ) 393 else if ( ret == test1 )
394 { 394 {
395 ; 395 ;
396 } 396 }
397 delete popup; 397 delete popup;
398 } 398 }
399 delete menu; 399 delete menu;
400} 400}
401 401
402 402
403/** 403/**
404 * Search and display avail. services for a device (on expand from device listing) 404 * Search and display avail. services for a device (on expand from device listing)
405 * @param item the service item returned 405 * @param item the service item returned
406 */ 406 */
407void BlueBase::addServicesToDevice( BTDeviceItem * item ) 407void BlueBase::addServicesToDevice( BTDeviceItem * item )
408{ 408{
409 qDebug("addServicesToDevice"); 409 odebug << "addServicesToDevice" << oendl;
410 // row of mac adress text(3) 410 // row of mac adress text(3)
411 RemoteDevice device = item->remoteDevice(); 411 RemoteDevice device = item->remoteDevice();
412 m_deviceList.insert( item->mac() , item ); 412 m_deviceList.insert( item->mac() , item );
413 // and some time later I get a signal foundServices( const QString& device, Services::ValueList ); back 413 // and some time later I get a signal foundServices( const QString& device, Services::ValueList ); back
414 m_localDevice->searchServices( device ); 414 m_localDevice->searchServices( device );
415} 415}
416 416
417 417
418/** 418/**
419 * Overloaded. This one it the one that is 419 * Overloaded. This one it the one that is
420 ted to the foundServices signal 420 ted to the foundServices signal
421 * @param device the mac address of the remote device 421 * @param device the mac address of the remote device
422 * @param servicesList the list with the service the device has. 422 * @param servicesList the list with the service the device has.
423 */ 423 */
424void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList ) 424void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList )
425{ 425{
426 qDebug("fill services list"); 426 odebug << "fill services list" << oendl;
427 427
428 QMap<QString,BTDeviceItem*>::Iterator it; 428 QMap<QString,BTDeviceItem*>::Iterator it;
429 BTDeviceItem* deviceItem = 0; 429 BTDeviceItem* deviceItem = 0;
430 430
431 // get the right devices which requested the search 431 // get the right devices which requested the search
432 it = m_deviceList.find( device ); 432 it = m_deviceList.find( device );
433 if( it == m_deviceList.end() ) 433 if( it == m_deviceList.end() )
434 return; 434 return;
435 deviceItem = it.data(); 435 deviceItem = it.data();
436 436
437 // remove previous entries 437 // remove previous entries
438 QList<QListViewItem> tempList; 438 QList<QListViewItem> tempList;
439 tempList.setAutoDelete( true ); 439 tempList.setAutoDelete( true );
440 QListViewItem * child = deviceItem->firstChild(); 440 QListViewItem * child = deviceItem->firstChild();
441 while( child ) 441 while( child )
442 { 442 {
443 tempList.append( child ); 443 tempList.append( child );
444 child = child->nextSibling(); 444 child = child->nextSibling();
445 } 445 }
446 tempList.clear(); 446 tempList.clear();
447 447
448 QValueList<OpieTooth::Services>::Iterator it2; 448 QValueList<OpieTooth::Services>::Iterator it2;
449 BTServiceItem* serviceItem; 449 BTServiceItem* serviceItem;
450 450
451 451
452 if (!servicesList.isEmpty() ) 452 if (!servicesList.isEmpty() )
453 { 453 {
454 // add services 454 // add services
455 QMap<int, QString> list; 455 QMap<int, QString> list;
456 QMap<int, QString>::Iterator classIt; 456 QMap<int, QString>::Iterator classIt;
457 for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 ) 457 for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 )
458 { 458 {
459 serviceItem = new BTServiceItem( deviceItem, (*it2) ); 459 serviceItem = new BTServiceItem( deviceItem, (*it2) );
460 list = (*it2).classIdList(); 460 list = (*it2).classIdList();
461 classIt = list.begin(); 461 classIt = list.begin();
462 int classId=0; 462 int classId=0;
463 if ( classIt != list.end() ) 463 if ( classIt != list.end() )
464 { 464 {
465 classId = classIt.key(); 465 classId = classIt.key();
466 } 466 }
467 467
468 serviceItem->setPixmap( 0, m_iconLoader->serviceIcon( classId ) ); 468 serviceItem->setPixmap( 0, m_iconLoader->serviceIcon( classId ) );
469 } 469 }
470 } 470 }
471 else 471 else
472 { 472 {
473 Services s1; 473 Services s1;
474 s1.setServiceName( tr("no services found") ); 474 s1.setServiceName( tr("no services found") );
@@ -562,97 +562,97 @@ void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList )
562 { 562 {
563 if( ( ((BTConnectionItem*)it2.current())->connection().mac() ) == (*it).mac() ) 563 if( ( ((BTConnectionItem*)it2.current())->connection().mac() ) == (*it).mac() )
564 { 564 {
565 found = true; 565 found = true;
566 } 566 }
567 } 567 }
568 568
569 if ( !found ) 569 if ( !found )
570 { 570 {
571 delete it2.current(); 571 delete it2.current();
572 } 572 }
573 573
574 } 574 }
575 575
576 576
577 } 577 }
578 else 578 else
579 { 579 {
580 ListView4->clear(); 580 ListView4->clear();
581 ConnectionState con; 581 ConnectionState con;
582 con.setMac( tr("No connections found") ); 582 con.setMac( tr("No connections found") );
583 connectionItem = new BTConnectionItem( ListView4 , con ); 583 connectionItem = new BTConnectionItem( ListView4 , con );
584 } 584 }
585 585
586 // recall connection search after some time 586 // recall connection search after some time
587 QTimer::singleShot( 15000, this, SLOT( addConnectedDevices() ) ); 587 QTimer::singleShot( 15000, this, SLOT( addConnectedDevices() ) );
588} 588}
589 589
590 590
591/** 591/**
592 * Find out if a device can currently be reached 592 * Find out if a device can currently be reached
593 * @param device 593 * @param device
594 */ 594 */
595void BlueBase::deviceActive( const RemoteDevice &device ) 595void BlueBase::deviceActive( const RemoteDevice &device )
596{ 596{
597 // search by mac, async, gets a signal back 597 // search by mac, async, gets a signal back
598 // We should have a BTDeviceItem there or where does it get added to the map -zecke 598 // We should have a BTDeviceItem there or where does it get added to the map -zecke
599 m_localDevice->isAvailable( device.mac() ); 599 m_localDevice->isAvailable( device.mac() );
600} 600}
601 601
602 602
603/** 603/**
604 * The signal catcher. Set the avail. status on device. 604 * The signal catcher. Set the avail. status on device.
605 * @param device - the mac address 605 * @param device - the mac address
606 * @param connected - if it is avail. or not 606 * @param connected - if it is avail. or not
607 */ 607 */
608void BlueBase::deviceActive( const QString& device, bool connected ) 608void BlueBase::deviceActive( const QString& device, bool connected )
609{ 609{
610 qDebug("deviceActive slot"); 610 odebug << "deviceActive slot" << oendl;
611 611
612 QMap<QString,BTDeviceItem*>::Iterator it; 612 QMap<QString,BTDeviceItem*>::Iterator it;
613 613
614 it = m_deviceList.find( device ); 614 it = m_deviceList.find( device );
615 if( it == m_deviceList.end() ) 615 if( it == m_deviceList.end() )
616 return; 616 return;
617 617
618 BTDeviceItem* deviceItem = it.data(); 618 BTDeviceItem* deviceItem = it.data();
619 619
620 620
621 if ( connected ) 621 if ( connected )
622 { 622 {
623 deviceItem->setPixmap( 1, m_onPix ); 623 deviceItem->setPixmap( 1, m_onPix );
624 } 624 }
625 else 625 else
626 { 626 {
627 deviceItem->setPixmap( 1, m_offPix ); 627 deviceItem->setPixmap( 1, m_offPix );
628 } 628 }
629 m_deviceList.remove( it ); 629 m_deviceList.remove( it );
630} 630}
631 631
632 632
633/** 633/**
634 * Open the "scan for devices" dialog 634 * Open the "scan for devices" dialog
635 */ 635 */
636void BlueBase::startScan() 636void BlueBase::startScan()
637{ 637{
638 ScanDialog *scan = new ScanDialog( this, "ScanDialog", 638 ScanDialog *scan = new ScanDialog( this, "ScanDialog",
639 true, WDestructiveClose ); 639 true, WDestructiveClose );
640 QObject::connect( scan, SIGNAL( selectedDevices(const QValueList<RemoteDevice>&) ), 640 QObject::connect( scan, SIGNAL( selectedDevices(const QValueList<RemoteDevice>&) ),
641 this, SLOT( addSearchedDevices(const QValueList<RemoteDevice>&) ) ); 641 this, SLOT( addSearchedDevices(const QValueList<RemoteDevice>&) ) );
642 642
643 QPEApplication::showDialog( scan ); 643 QPEApplication::showDialog( scan );
644} 644}
645 645
646 646
647/** 647/**
648 * Set the informations about the local device in information Tab 648 * Set the informations about the local device in information Tab
649 */ 649 */
650void BlueBase::setInfo() 650void BlueBase::setInfo()
651{ 651{
652 StatusLabel->setText( status() ); 652 StatusLabel->setText( status() );
653} 653}
654 654
655 655
656/** 656/**
657 * Decontructor 657 * Decontructor
658 */ 658 */
diff --git a/noncore/net/opietooth/manager/devicehandler.cpp b/noncore/net/opietooth/manager/devicehandler.cpp
index 9c5b817..bd34351 100644
--- a/noncore/net/opietooth/manager/devicehandler.cpp
+++ b/noncore/net/opietooth/manager/devicehandler.cpp
@@ -1,87 +1,87 @@
1 1
2#include <stdlib.h> 2#include <stdlib.h>
3 3
4#include <qdir.h> 4#include <qdir.h>
5#include <qpe/config.h> 5#include <qpe/config.h>
6 6
7#include "devicehandler.h" 7#include "devicehandler.h"
8 8
9using namespace OpieTooth; 9using namespace OpieTooth;
10 10
11DeviceHandler::DeviceHandler() { 11DeviceHandler::DeviceHandler() {
12 12
13}; 13};
14DeviceHandler::~DeviceHandler() { 14DeviceHandler::~DeviceHandler() {
15 15
16} 16}
17 17
18RemoteDevice::ValueList DeviceHandler::load() { 18RemoteDevice::ValueList DeviceHandler::load() {
19 RemoteDevice::ValueList list; 19 RemoteDevice::ValueList list;
20QString path = QDir::homeDirPath() + "/Settings/bluetooth"; 20QString path = QDir::homeDirPath() + "/Settings/bluetooth";
21 QDir deviceListSave( path); 21 QDir deviceListSave( path);
22 22
23 // list of .conf files 23 // list of .conf files
24 QStringList devicesFileList = deviceListSave.entryList(); 24 QStringList devicesFileList = deviceListSave.entryList();
25 25
26 26
27 // cut .conf of to get the mac and also read the name entry in it. 27 // cut .conf of to get the mac and also read the name entry in it.
28 if (!devicesFileList.isEmpty() ) { 28 if (!devicesFileList.isEmpty() ) {
29 QString name; 29 QString name;
30 QString mac; 30 QString mac;
31 QStringList::Iterator it; 31 QStringList::Iterator it;
32 for (it = devicesFileList.begin(); it != devicesFileList.end(); ++it ) { 32 for (it = devicesFileList.begin(); it != devicesFileList.end(); ++it ) {
33 if ( (*it) == "." || (*it) == ".." ) 33 if ( (*it) == "." || (*it) == ".." )
34 continue; 34 continue;
35 35
36 qDebug((*it).latin1() ); 36 odebug << (*it).latin1() << oendl;
37 Config conf(path + "/"+(*it), Config::File); 37 Config conf(path + "/"+(*it), Config::File);
38 conf.setGroup("Info"); 38 conf.setGroup("Info");
39 name = conf.readEntry("name", "Error"); 39 name = conf.readEntry("name", "Error");
40 mac = conf.readEntry("mac", QString::null); 40 mac = conf.readEntry("mac", QString::null);
41 qDebug("MAC: " + mac); 41 odebug << "MAC: " + mac << oendl;
42 qDebug("NAME: " + name); 42 odebug << "NAME: " + name << oendl;
43 if (mac.isEmpty() ) 43 if (mac.isEmpty() )
44 continue; 44 continue;
45 RemoteDevice currentDevice( mac , name ); 45 RemoteDevice currentDevice( mac , name );
46 list.append( currentDevice ); 46 list.append( currentDevice );
47 } 47 }
48 } 48 }
49 return list; 49 return list;
50}; 50};
51/* 51/*
52 * This is some how rude but make sure all old devices 52 * This is some how rude but make sure all old devices
53 * are getting deleted 53 * are getting deleted
54 */ 54 */
55void DeviceHandler::save( const RemoteDevice::ValueList& list) { 55void DeviceHandler::save( const RemoteDevice::ValueList& list) {
56 QCString rm; 56 QCString rm;
57 rm += "rm -rf "; 57 rm += "rm -rf ";
58 rm += QDir::homeDirPath() + "/Settings/bluetooth"; 58 rm += QDir::homeDirPath() + "/Settings/bluetooth";
59 system ( rm.data() ); 59 system ( rm.data() );
60 60
61 if (list.isEmpty() ) // no need to create the dir 61 if (list.isEmpty() ) // no need to create the dir
62 return; 62 return;
63 63
64 /** 64 /**
65 * Create a new dir 65 * Create a new dir
66 */ 66 */
67 rm = "mkdir "; 67 rm = "mkdir ";
68 rm += QDir::homeDirPath() + "/Settings/bluetooth"; 68 rm += QDir::homeDirPath() + "/Settings/bluetooth";
69 qWarning("out %s", rm.data() ); 69 owarn << "out " << rm.data() << "" << oendl;
70 system( rm.data() ); 70 system( rm.data() );
71 71
72 RemoteDevice::ValueList::ConstIterator it; 72 RemoteDevice::ValueList::ConstIterator it;
73 // write the config 73 // write the config
74 74
75 for ( it = list.begin(); it != list.end(); ++it ) { 75 for ( it = list.begin(); it != list.end(); ++it ) {
76 qDebug( "/Settings/bluetooth/" + (*it).mac() + ".conf"); 76 odebug << "/Settings/bluetooth/" + (*it).mac() + ".conf" << oendl;
77 77
78 Config conf( QDir::homeDirPath() + 78 Config conf( QDir::homeDirPath() +
79 "/Settings/bluetooth/" + 79 "/Settings/bluetooth/" +
80 (*it).mac() + ".conf", Config::File ); 80 (*it).mac() + ".conf", Config::File );
81 81
82 conf.setGroup( "Info" ); 82 conf.setGroup( "Info" );
83 conf.writeEntry( "name", (*it).name() ); 83 conf.writeEntry( "name", (*it).name() );
84 conf.writeEntry( "mac", (*it).mac() ); 84 conf.writeEntry( "mac", (*it).mac() );
85 } 85 }
86 86
87} 87}
diff --git a/noncore/net/opietooth/manager/dunpopup.cpp b/noncore/net/opietooth/manager/dunpopup.cpp
index 3043f71..5b01d2f 100644
--- a/noncore/net/opietooth/manager/dunpopup.cpp
+++ b/noncore/net/opietooth/manager/dunpopup.cpp
@@ -1,62 +1,62 @@
1#include <qpe/qcopenvelope_qws.h> 1#include <qpe/qcopenvelope_qws.h>
2 2
3#include <qtimer.h> 3#include <qtimer.h>
4 4
5#include "dunpopup.h" 5#include "dunpopup.h"
6 6
7using namespace OpieTooth; 7using namespace OpieTooth;
8 8
9/* 9/*
10 * c'tor init the QAction 10 * c'tor init the QAction
11 */ 11 */
12DunPopup::DunPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() { 12DunPopup::DunPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() {
13 13
14 qWarning("DunPopup c'tor"); 14 owarn << "DunPopup c'tor" << oendl;
15 15
16 m_item = item; 16 m_item = item;
17 QAction *a, *b, *c; 17 QAction *a, *b, *c;
18 18
19 m_dunconnection = 0l; 19 m_dunconnection = 0l;
20 /* connect action */ 20 /* connect action */
21 21
22 22
23 a = new QAction(); // so it's get deleted 23 a = new QAction(); // so it's get deleted
24 a->setText( tr("connect") ); 24 a->setText( tr("connect") );
25 a->addTo( this ); 25 a->addTo( this );
26 connect( a, SIGNAL( activated() ), this, SLOT( slotConnect() ) ); 26 connect( a, SIGNAL( activated() ), this, SLOT( slotConnect() ) );
27 27
28 28
29 b = new QAction(); 29 b = new QAction();
30 b->setText( tr( "connect+conf" ) ); 30 b->setText( tr( "connect+conf" ) );
31 b->addTo( this ); 31 b->addTo( this );
32 connect( b, SIGNAL( activated() ), this, SLOT( slotConnectAndConfig() ) ); 32 connect( b, SIGNAL( activated() ), this, SLOT( slotConnectAndConfig() ) );
33 33
34 c = new QAction(); 34 c = new QAction();
35 c->setText( tr( "disconnect" ) ); 35 c->setText( tr( "disconnect" ) );
36 c->addTo( this ); 36 c->addTo( this );
37 connect( c, SIGNAL( activated() ), this, SLOT( slotDisconnect() ) ); 37 connect( c, SIGNAL( activated() ), this, SLOT( slotDisconnect() ) );
38 38
39}; 39};
40 40
41DunPopup::~DunPopup() { 41DunPopup::~DunPopup() {
42 42
43} 43}
44 44
45void DunPopup::slotConnect() { 45void DunPopup::slotConnect() {
46 46
47 m_dunconnection = new StartDunConnection( m_item->mac() ); 47 m_dunconnection = new StartDunConnection( m_item->mac() );
48 m_dunconnection->start(); 48 m_dunconnection->start();
49} 49}
50 50
51void DunPopup::slotDisconnect() { 51void DunPopup::slotDisconnect() {
52 m_dunconnection->stop(); 52 m_dunconnection->stop();
53} 53}
54 54
55 55
56void DunPopup::slotConnectAndConfig() { 56void DunPopup::slotConnectAndConfig() {
57 slotConnect(); 57 slotConnect();
58 58
59 // more intelligence here later like passing the device ( bnepX ) 59 // more intelligence here later like passing the device ( bnepX )
60 QCopEnvelope e( "QPE/System", "execute(QString)" ); 60 QCopEnvelope e( "QPE/System", "execute(QString)" );
61 e << QString( "networksettings" ); 61 e << QString( "networksettings" );
62 62
diff --git a/noncore/net/opietooth/manager/hciconfwrapper.cpp b/noncore/net/opietooth/manager/hciconfwrapper.cpp
index 35e9cd9..71c935c 100644
--- a/noncore/net/opietooth/manager/hciconfwrapper.cpp
+++ b/noncore/net/opietooth/manager/hciconfwrapper.cpp
@@ -29,111 +29,111 @@ namespace OpieTooth {
29 if ( enable ) { 29 if ( enable ) {
30 setValue( "iscan" , "enable" ); 30 setValue( "iscan" , "enable" );
31 } else { 31 } else {
32 setValue( "iscan" , "disable" ); 32 setValue( "iscan" , "disable" );
33 } 33 }
34 } 34 }
35 35
36 void HciConfWrapper::setPscan( bool enable) { 36 void HciConfWrapper::setPscan( bool enable) {
37 37
38 if ( enable ) { 38 if ( enable ) {
39 setValue( "pscan" , "enable" ); 39 setValue( "pscan" , "enable" );
40 } else { 40 } else {
41 setValue( "pscan" , "disable" ); 41 setValue( "pscan" , "disable" );
42 } 42 }
43 } 43 }
44 44
45 45
46 void HciConfWrapper::setAuth( bool enable) { 46 void HciConfWrapper::setAuth( bool enable) {
47 47
48 if ( enable ) { 48 if ( enable ) {
49 setValue( "auth" , "enable" ); 49 setValue( "auth" , "enable" );
50 } else { 50 } else {
51 setValue( "auth" , "disable" ); 51 setValue( "auth" , "disable" );
52 } 52 }
53 } 53 }
54 54
55 55
56 void HciConfWrapper::setEncrypt( bool enable) { 56 void HciConfWrapper::setEncrypt( bool enable) {
57 57
58 if ( enable ) { 58 if ( enable ) {
59 setValue( "encrypt" , "enable" ); 59 setValue( "encrypt" , "enable" );
60 } else { 60 } else {
61 setValue( "encrypt" , "disable" ); 61 setValue( "encrypt" , "disable" );
62 } 62 }
63 } 63 }
64 64
65 65
66 void HciConfWrapper::setValue(const QString &key, const QString &value ) { 66 void HciConfWrapper::setValue(const QString &key, const QString &value ) {
67 67
68 if (m_file.isEmpty() ) // load first 68 if (m_file.isEmpty() ) // load first
69 return; 69 return;
70 70
71 QStringList::Iterator it; 71 QStringList::Iterator it;
72 72
73 QString str; 73 QString str;
74 for (it = m_file.begin(); it != m_file.end(); ++it ) { 74 for (it = m_file.begin(); it != m_file.end(); ++it ) {
75 str = (*it); 75 str = (*it);
76 if( (str.contains(key)) > 0 ) { 76 if( (str.contains(key)) > 0 ) {
77 qDebug("Found"); 77 odebug << "Found" << oendl;
78 // still need to look if its commented out!!! 78 // still need to look if its commented out!!!
79 str.simplifyWhiteSpace(); 79 str.simplifyWhiteSpace();
80 qDebug( key ); 80 odebug << key << oendl;
81 if (str.startsWith("#")) { 81 if (str.startsWith("#")) {
82 str = (key + " " + value + ";"); 82 str = (key + " " + value + ";");
83 } else { 83 } else {
84 str = str.replace( QRegExp( "\\s*"+key+"\\s+[^\\s][^;]*;" ), key + " " + value + ";"); 84 str = str.replace( QRegExp( "\\s*"+key+"\\s+[^\\s][^;]*;" ), key + " " + value + ";");
85 } 85 }
86 qDebug( str ); 86 odebug << str << oendl;
87 it = m_file.remove( it ); 87 it = m_file.remove( it );
88 it = m_file.insert( it, str ); 88 it = m_file.insert( it, str );
89 //return; the regexp is too wide -zecke // all set 89 //return; the regexp is too wide -zecke // all set
90 } 90 }
91 } 91 }
92 92
93 93
94 } 94 }
95 95
96 /** 96 /**
97 * This loads the config file and stores it inside 97 * This loads the config file and stores it inside
98 * the m_file 98 * the m_file
99 */ 99 */
100 void HciConfWrapper::load() { 100 void HciConfWrapper::load() {
101 qWarning("loaded"); 101 owarn << "loaded" << oendl;
102 m_file.clear(); 102 m_file.clear();
103 QFile file( m_fileName ); 103 QFile file( m_fileName );
104 if (!file.open( IO_ReadOnly ) ) { 104 if (!file.open( IO_ReadOnly ) ) {
105 qDebug("Could not open"); 105 odebug << "Could not open" << oendl;
106 return; 106 return;
107 } 107 }
108 108
109 /** 109 /**
110 * readAll() into a QByteArray 110 * readAll() into a QByteArray
111 * QStringList::split('\n', array ) 111 * QStringList::split('\n', array )
112 * would this be faster? -zecke 112 * would this be faster? -zecke
113 */ 113 */
114 QTextStream stream(&file ); 114 QTextStream stream(&file );
115 QString tmp; 115 QString tmp;
116 while ( !stream.atEnd() ) { 116 while ( !stream.atEnd() ) {
117 tmp = stream.readLine(); 117 tmp = stream.readLine();
118 m_file.append( tmp ); 118 m_file.append( tmp );
119 } 119 }
120 } 120 }
121 void HciConfWrapper::save() { 121 void HciConfWrapper::save() {
122 qWarning("save"); 122 owarn << "save" << oendl;
123 if (m_file.isEmpty() ) // load first 123 if (m_file.isEmpty() ) // load first
124 return; 124 return;
125 125
126 QFile file( m_fileName ); 126 QFile file( m_fileName );
127 if ( !file.open(IO_WriteOnly ) ) { 127 if ( !file.open(IO_WriteOnly ) ) {
128 qWarning("could not open %s", m_fileName.latin1() ); 128 owarn << "could not open " << m_fileName.latin1() << "" << oendl;
129 return; 129 return;
130 } 130 }
131 131
132 QTextStream stream(&file ); 132 QTextStream stream(&file );
133 QStringList::Iterator it; 133 QStringList::Iterator it;
134 for ( it = m_file.begin(); it != m_file.end(); ++it ) { 134 for ( it = m_file.begin(); it != m_file.end(); ++it ) {
135 stream << (*it) << endl; 135 stream << (*it) << endl;
136 } 136 }
137 qWarning("saved"); 137 owarn << "saved" << oendl;
138 }; 138 };
139} 139}
diff --git a/noncore/net/opietooth/manager/obexdialog.cpp b/noncore/net/opietooth/manager/obexdialog.cpp
index 1ef862a..3a3dbb0 100644
--- a/noncore/net/opietooth/manager/obexdialog.cpp
+++ b/noncore/net/opietooth/manager/obexdialog.cpp
@@ -35,55 +35,55 @@ ObexDialog::ObexDialog( QWidget* parent, const char* name, bool modal, WFlags f
35 35
36 QPushButton *browserButton; 36 QPushButton *browserButton;
37 browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); 37 browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton");
38 connect( browserButton, SIGNAL(released() ), this , SLOT(browse() ) ); 38 connect( browserButton, SIGNAL(released() ), this , SLOT(browse() ) );
39 39
40 chNameLine = new QLineEdit( this ); 40 chNameLine = new QLineEdit( this );
41 41
42 sendButton = new QPushButton( this ); 42 sendButton = new QPushButton( this );
43 sendButton->setText( tr( "Send" ) ); 43 sendButton->setText( tr( "Send" ) );
44 44
45 layout->addWidget(info); 45 layout->addWidget(info);
46 layout->addWidget(cmdLine); 46 layout->addWidget(cmdLine);
47 layout->addWidget(browserButton); 47 layout->addWidget(browserButton);
48 layout->addWidget(chNameLine); 48 layout->addWidget(chNameLine);
49 layout->addWidget(sendButton); 49 layout->addWidget(sendButton);
50 50
51 connect( sendButton, SIGNAL( clicked() ), this, SLOT( sendData() ) ); 51 connect( sendButton, SIGNAL( clicked() ), this, SLOT( sendData() ) );
52 52
53} 53}
54 54
55ObexDialog::~ObexDialog() { 55ObexDialog::~ObexDialog() {
56} 56}
57 57
58void ObexDialog::browse() { 58void ObexDialog::browse() {
59 59
60 MimeTypes types; 60 MimeTypes types;
61 QStringList all; 61 QStringList all;
62 all << "*/*"; 62 all << "*/*";
63 types.insert("All Files", all ); 63 types.insert("All Files", all );
64 64
65 QString str = OFileDialog::getOpenFileName( 1,"/","", types, 0 ); 65 QString str = OFileDialog::getOpenFileName( 1,"/","", types, 0 );
66 cmdLine->setText( str ); 66 cmdLine->setText( str );
67 67
68} 68}
69 69
70void ObexDialog::sendData() { 70void ObexDialog::sendData() {
71 QString fileURL = cmdLine->text(); 71 QString fileURL = cmdLine->text();
72 QString file = QFileInfo( fileURL ).fileName(); 72 QString file = QFileInfo( fileURL ).fileName();
73 QString modifiedName = chNameLine->text(); 73 QString modifiedName = chNameLine->text();
74 74
75 // vom popupmenu beziehen 75 // vom popupmenu beziehen
76 OProcess* obexSend = new OProcess(); 76 OProcess* obexSend = new OProcess();
77 if ( !modifiedName.isEmpty() ) { 77 if ( !modifiedName.isEmpty() ) {
78 *obexSend << "ussp-push" << m_device << fileURL << modifiedName; 78 *obexSend << "ussp-push" << m_device << fileURL << modifiedName;
79 } else { 79 } else {
80 *obexSend << "ussp-push" << m_device << fileURL << file; 80 *obexSend << "ussp-push" << m_device << fileURL << file;
81 } 81 }
82 if (!obexSend->start(OProcess::DontCare, OProcess::AllOutput) ) { 82 if (!obexSend->start(OProcess::DontCare, OProcess::AllOutput) ) {
83 qWarning("could not start"); 83 owarn << "could not start" << oendl;
84 delete obexSend; 84 delete obexSend;
85 } 85 }
86 86
87 87
88 88
89} 89}
diff --git a/noncore/net/opietooth/manager/obexpopup.cpp b/noncore/net/opietooth/manager/obexpopup.cpp
index d147d52..9a50199 100644
--- a/noncore/net/opietooth/manager/obexpopup.cpp
+++ b/noncore/net/opietooth/manager/obexpopup.cpp
@@ -1,45 +1,45 @@
1 1
2#include "obexdialog.h" 2#include "obexdialog.h"
3#include "obexpopup.h" 3#include "obexpopup.h"
4 4
5/* OPIE */ 5/* OPIE */
6#include <qpe/qpeapplication.h> 6#include <qpe/qpeapplication.h>
7 7
8/* QT */ 8/* QT */
9#include <qtimer.h> 9#include <qtimer.h>
10 10
11using namespace OpieTooth; 11using namespace OpieTooth;
12 12
13/* 13/*
14 * c'tor init the QAction 14 * c'tor init the QAction
15 */ 15 */
16ObexPopup::ObexPopup() 16ObexPopup::ObexPopup()
17 : QPopupMenu() 17 : QPopupMenu()
18{ 18{
19 qWarning("RfcCommPopup c'tor"); 19 owarn << "RfcCommPopup c'tor" << oendl;
20 20
21 QAction* a; 21 QAction* a;
22 22
23 /* connect action */ 23 /* connect action */
24 a = new QAction( ); // so it's get deleted 24 a = new QAction( ); // so it's get deleted
25 a->setText("Push file"); 25 a->setText("Push file");
26 a->addTo( this ); 26 a->addTo( this );
27 connect( a, SIGNAL( activated() ), 27 connect( a, SIGNAL( activated() ),
28 this, SLOT( slotPush() ) ); 28 this, SLOT( slotPush() ) );
29}; 29};
30 30
31 31
32ObexPopup::~ObexPopup() 32ObexPopup::~ObexPopup()
33{} 33{}
34 34
35 35
36void ObexPopup::slotPush() 36void ObexPopup::slotPush()
37{ 37{
38 38
39 qWarning("push something"); 39 owarn << "push something" << oendl;
40 40
41 ObexDialog obexDialog; 41 ObexDialog obexDialog;
42 QPEApplication::execDialog( &obexDialog ); 42 QPEApplication::execDialog( &obexDialog );
43} 43}
44 44
45 45
diff --git a/noncore/net/opietooth/manager/panpopup.cpp b/noncore/net/opietooth/manager/panpopup.cpp
index 8b05964..43c2777 100644
--- a/noncore/net/opietooth/manager/panpopup.cpp
+++ b/noncore/net/opietooth/manager/panpopup.cpp
@@ -1,62 +1,62 @@
1#include <qpe/qcopenvelope_qws.h> 1#include <qpe/qcopenvelope_qws.h>
2 2
3#include <qtimer.h> 3#include <qtimer.h>
4 4
5#include "panpopup.h" 5#include "panpopup.h"
6 6
7using namespace OpieTooth; 7using namespace OpieTooth;
8 8
9/* 9/*
10 * c'tor init the QAction 10 * c'tor init the QAction
11 */ 11 */
12PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() { 12PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() {
13 13
14 qWarning("PanPopup c'tor"); 14 owarn << "PanPopup c'tor" << oendl;
15 15
16 m_item = item; 16 m_item = item;
17 QAction *a, *b, *c; 17 QAction *a, *b, *c;
18 18
19 m_panconnection = 0l; 19 m_panconnection = 0l;
20 /* connect action */ 20 /* connect action */
21 21
22 22
23 a = new QAction(); // so it's get deleted 23 a = new QAction(); // so it's get deleted
24 a->setText( tr("connect") ); 24 a->setText( tr("connect") );
25 a->addTo( this ); 25 a->addTo( this );
26 connect( a, SIGNAL( activated() ), this, SLOT( slotConnect() ) ); 26 connect( a, SIGNAL( activated() ), this, SLOT( slotConnect() ) );
27 27
28 28
29 b = new QAction(); 29 b = new QAction();
30 b->setText( tr( "connect+conf" ) ); 30 b->setText( tr( "connect+conf" ) );
31 b->addTo( this ); 31 b->addTo( this );
32 connect( b, SIGNAL( activated() ), this, SLOT( slotConnectAndConfig() ) ); 32 connect( b, SIGNAL( activated() ), this, SLOT( slotConnectAndConfig() ) );
33 33
34 c = new QAction(); 34 c = new QAction();
35 c->setText( tr( "disconnect" ) ); 35 c->setText( tr( "disconnect" ) );
36 c->addTo( this ); 36 c->addTo( this );
37 connect( c, SIGNAL( activated() ), this, SLOT( slotDisconnect() ) ); 37 connect( c, SIGNAL( activated() ), this, SLOT( slotDisconnect() ) );
38 38
39}; 39};
40 40
41PanPopup::~PanPopup() { 41PanPopup::~PanPopup() {
42 42
43} 43}
44 44
45void PanPopup::slotConnect() { 45void PanPopup::slotConnect() {
46 46
47 m_panconnection = new StartPanConnection( m_item->mac() ); 47 m_panconnection = new StartPanConnection( m_item->mac() );
48 m_panconnection->start(); 48 m_panconnection->start();
49} 49}
50 50
51void PanPopup::slotDisconnect() { 51void PanPopup::slotDisconnect() {
52 if (!m_panconnection) m_panconnection = new StartPanConnection( m_item->mac() ); 52 if (!m_panconnection) m_panconnection = new StartPanConnection( m_item->mac() );
53 m_panconnection->stop(); 53 m_panconnection->stop();
54} 54}
55 55
56 56
57void PanPopup::slotConnectAndConfig() { 57void PanPopup::slotConnectAndConfig() {
58 slotConnect(); 58 slotConnect();
59 59
60 // more intelligence here later like passing the device ( bnepX ) 60 // more intelligence here later like passing the device ( bnepX )
61 QCopEnvelope e( "QPE/System", "execute(QString)" ); 61 QCopEnvelope e( "QPE/System", "execute(QString)" );
62 e << QString( "networksettings" ); 62 e << QString( "networksettings" );
diff --git a/noncore/net/opietooth/manager/popuphelper.cpp b/noncore/net/opietooth/manager/popuphelper.cpp
index ab22fea..19deb19 100644
--- a/noncore/net/opietooth/manager/popuphelper.cpp
+++ b/noncore/net/opietooth/manager/popuphelper.cpp
@@ -1,36 +1,36 @@
1 1
2#include "stdpopups.h" 2#include "stdpopups.h"
3#include "popuphelper.h" 3#include "popuphelper.h"
4 4
5using namespace OpieTooth; 5using namespace OpieTooth;
6 6
7PopupHelper::PopupHelper() { 7PopupHelper::PopupHelper() {
8 init(); 8 init();
9} 9}
10 10
11PopupHelper::~PopupHelper() { 11PopupHelper::~PopupHelper() {
12} 12}
13 13
14void PopupHelper::insert( int id, popupFactory fact ) { 14void PopupHelper::insert( int id, popupFactory fact ) {
15 m_map.insert(id, fact ); 15 m_map.insert(id, fact );
16} 16}
17 17
18QPopupMenu* PopupHelper::find( int id, const Services& ser, BTDeviceItem* item ) { 18QPopupMenu* PopupHelper::find( int id, const Services& ser, BTDeviceItem* item ) {
19 //qWarning("find"); 19 //owarn << "find" << oendl;
20 FactoryMap::Iterator it = m_map.find(id ); 20 FactoryMap::Iterator it = m_map.find(id );
21 if ( it != m_map.end() ) { 21 if ( it != m_map.end() ) {
22 //qWarning("found"); 22 //owarn << "found" << oendl;
23 popupFactory fact = it.data(); 23 popupFactory fact = it.data();
24 return (*fact)(ser, item); 24 return (*fact)(ser, item);
25 } 25 }
26 return 0l; 26 return 0l;
27} 27}
28 28
29void PopupHelper::init() { 29void PopupHelper::init() {
30 insert( 4355, newRfcComPopup ); 30 insert( 4355, newRfcComPopup );
31 insert( 4354, newDunPopup ); 31 insert( 4354, newDunPopup );
32 insert( 4353, newRfcComPopup ); 32 insert( 4353, newRfcComPopup );
33 insert( 4357, newObexPushPopup ); 33 insert( 4357, newObexPushPopup );
34 insert( 4358, newObexPushPopup ); 34 insert( 4358, newObexPushPopup );
35 insert( 4374, newPanPopup ); 35 insert( 4374, newPanPopup );
36} 36}
diff --git a/noncore/net/opietooth/manager/pppdialog.cpp b/noncore/net/opietooth/manager/pppdialog.cpp
index 78c1501..989bf45 100644
--- a/noncore/net/opietooth/manager/pppdialog.cpp
+++ b/noncore/net/opietooth/manager/pppdialog.cpp
@@ -11,59 +11,59 @@ using namespace OpieTooth;
11 11
12using namespace Opie::Core; 12using namespace Opie::Core;
13PPPDialog::PPPDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device ) 13PPPDialog::PPPDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device )
14 : QDialog( parent, name, modal, fl ) { 14 : QDialog( parent, name, modal, fl ) {
15 15
16 if ( !name ) 16 if ( !name )
17 setName( "PPPDialog" ); 17 setName( "PPPDialog" );
18 setCaption( tr( "ppp connection " ) ) ; 18 setCaption( tr( "ppp connection " ) ) ;
19 19
20 m_device = device; 20 m_device = device;
21 21
22 layout = new QVBoxLayout( this ); 22 layout = new QVBoxLayout( this );
23 23
24 QLabel* info = new QLabel( this ); 24 QLabel* info = new QLabel( this );
25 info->setText( tr("Enter an ppp script name:") ); 25 info->setText( tr("Enter an ppp script name:") );
26 26
27 cmdLine = new QLineEdit( this ); 27 cmdLine = new QLineEdit( this );
28 28
29 outPut = new QMultiLineEdit( this ); 29 outPut = new QMultiLineEdit( this );
30 QFont outPut_font( outPut->font() ); 30 QFont outPut_font( outPut->font() );
31 outPut_font.setPointSize( 8 ); 31 outPut_font.setPointSize( 8 );
32 outPut->setFont( outPut_font ); 32 outPut->setFont( outPut_font );
33 outPut->setWordWrap( QMultiLineEdit::WidgetWidth ); 33 outPut->setWordWrap( QMultiLineEdit::WidgetWidth );
34 34
35 connectButton = new QPushButton( this ); 35 connectButton = new QPushButton( this );
36 connectButton->setText( tr( "Connect" ) ); 36 connectButton->setText( tr( "Connect" ) );
37 37
38 layout->addWidget(info); 38 layout->addWidget(info);
39 layout->addWidget(cmdLine); 39 layout->addWidget(cmdLine);
40 layout->addWidget(outPut); 40 layout->addWidget(outPut);
41 layout->addWidget(connectButton); 41 layout->addWidget(connectButton);
42 42
43 connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) ); 43 connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) );
44 44
45} 45}
46 46
47PPPDialog::~PPPDialog() { 47PPPDialog::~PPPDialog() {
48} 48}
49 49
50void PPPDialog::connectToDevice() { 50void PPPDialog::connectToDevice() {
51 outPut->clear(); 51 outPut->clear();
52 // vom popupmenu beziehen 52 // vom popupmenu beziehen
53 QString connectScript = "/etc/ppp/peers/" + cmdLine->text(); 53 QString connectScript = "/etc/ppp/peers/" + cmdLine->text();
54 OProcess* pppDial = new OProcess(); 54 OProcess* pppDial = new OProcess();
55 *pppDial << "pppd" << m_device << "call" << connectScript; 55 *pppDial << "pppd" << m_device << "call" << connectScript;
56 connect( pppDial, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int) ), 56 connect( pppDial, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int) ),
57 this, SLOT(fillOutPut(Opie::Core::OProcess*,char*,int) ) ); 57 this, SLOT(fillOutPut(Opie::Core::OProcess*,char*,int) ) );
58 if (!pppDial->start(OProcess::DontCare, OProcess::AllOutput) ) { 58 if (!pppDial->start(OProcess::DontCare, OProcess::AllOutput) ) {
59 qWarning("could not start"); 59 owarn << "could not start" << oendl;
60 delete pppDial; 60 delete pppDial;
61 } 61 }
62} 62}
63 63
64void PPPDialog::fillOutPut( OProcess* pppDial, char* cha, int len ) { 64void PPPDialog::fillOutPut( OProcess* pppDial, char* cha, int len ) {
65 QCString str(cha, len ); 65 QCString str(cha, len );
66 outPut->insertLine( str ); 66 outPut->insertLine( str );
67 delete pppDial; 67 delete pppDial;
68} 68}
69 69
diff --git a/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp b/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp
index fc76301..4469129 100644
--- a/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp
+++ b/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp
@@ -26,110 +26,110 @@ RfcommAssignDialog::RfcommAssignDialog( QWidget* parent, const char* name, bool
26 m_scrollView = new QScrollView( this ); 26 m_scrollView = new QScrollView( this );
27 m_scrollView->setResizePolicy( QScrollView::AutoOneFit ); 27 m_scrollView->setResizePolicy( QScrollView::AutoOneFit );
28 m_scrollView->setHScrollBarMode( QScrollView::AlwaysOff ); 28 m_scrollView->setHScrollBarMode( QScrollView::AlwaysOff );
29 29
30 RfcommAssignDialogBaseLayout->addWidget( m_scrollView ); 30 RfcommAssignDialogBaseLayout->addWidget( m_scrollView );
31 31
32 m_box = new QVBox( m_scrollView->viewport() ); 32 m_box = new QVBox( m_scrollView->viewport() );
33 m_scrollView->addChild( m_box ); 33 m_scrollView->addChild( m_box );
34 34
35 confHandler = new RfCommConfHandler( "/etc/bluetooth/rfcomm.conf" ); 35 confHandler = new RfCommConfHandler( "/etc/bluetooth/rfcomm.conf" );
36 36
37 loadConfig(); 37 loadConfig();
38} 38}
39 39
40RfcommAssignDialog::~RfcommAssignDialog() 40RfcommAssignDialog::~RfcommAssignDialog()
41{ 41{
42 if ( confHandler ) 42 if ( confHandler )
43 { 43 {
44 delete confHandler; 44 delete confHandler;
45 } 45 }
46} 46}
47 47
48 48
49void RfcommAssignDialog::newDevice( const QString & mac ) 49void RfcommAssignDialog::newDevice( const QString & mac )
50{ 50{
51 51
52 for ( int i = 0 ; i < m_range; i++ ) 52 for ( int i = 0 ; i < m_range; i++ )
53 { 53 {
54 54
55 QMap<QString, RfCommConfObject*>::Iterator it; 55 QMap<QString, RfCommConfObject*>::Iterator it;
56 it = confHandler->foundEntries().find( QString("%1").arg( i ) ); 56 it = confHandler->foundEntries().find( QString("%1").arg( i ) );
57 // make sure that rfcommX is not assigned yet 57 // make sure that rfcommX is not assigned yet
58 if ( it == confHandler->foundEntries().end() ) 58 if ( it == confHandler->foundEntries().end() )
59 { 59 {
60 QDialog dialog( this, "newdevice", true, WStyle_ContextHelp ); 60 QDialog dialog( this, "newdevice", true, WStyle_ContextHelp );
61 61
62 RfcommDialogItem *newDev = new RfcommDialogItem( &dialog ); 62 RfcommDialogItem *newDev = new RfcommDialogItem( &dialog );
63 newDev->setIdent( i ); 63 newDev->setIdent( i );
64 newDev->setMac( mac ); 64 newDev->setMac( mac );
65 65
66 if ( QPEApplication::execDialog( &dialog ) == QDialog::Accepted ) 66 if ( QPEApplication::execDialog( &dialog ) == QDialog::Accepted )
67 { 67 {
68 RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box ); 68 RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box );
69 m_itemList.insert( i , rfcomm ); 69 m_itemList.insert( i , rfcomm );
70 rfcomm->setIdent( i ); 70 rfcomm->setIdent( i );
71 rfcomm->setMac( mac ); 71 rfcomm->setMac( mac );
72 rfcomm->setChannel( newDev->channel() ); 72 rfcomm->setChannel( newDev->channel() );
73 rfcomm->setComment( newDev->comment() ); 73 rfcomm->setComment( newDev->comment() );
74 qDebug( "New device set up" ); 74 odebug << "New device set up" << oendl;
75 } 75 }
76 } 76 }
77 } 77 }
78} 78}
79 79
80void RfcommAssignDialog::loadConfig() 80void RfcommAssignDialog::loadConfig()
81{ 81{
82 82
83 //Config cfg( "bluetoothmanager-rfcommbind" ); 83 //Config cfg( "bluetoothmanager-rfcommbind" );
84 84
85 for ( int i = 0 ; i < m_range; i++ ) 85 for ( int i = 0 ; i < m_range; i++ )
86 { 86 {
87 // cfg.setGroup( QString("%1").arg( i ) ); 87 // cfg.setGroup( QString("%1").arg( i ) );
88 RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box ); 88 RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box );
89 m_itemList.insert( i , rfcomm ); 89 m_itemList.insert( i , rfcomm );
90 rfcomm->setIdent( i ); 90 rfcomm->setIdent( i );
91 QMap<QString, RfCommConfObject*>::Iterator it; 91 QMap<QString, RfCommConfObject*>::Iterator it;
92 it = confHandler->foundEntries().find( QString("%1").arg( i ) ); 92 it = confHandler->foundEntries().find( QString("%1").arg( i ) );
93 if ( it != confHandler->foundEntries().end() ) 93 if ( it != confHandler->foundEntries().end() )
94 { 94 {
95 qDebug( "Found key in foundEntries() " ); 95 odebug << "Found key in foundEntries() " << oendl;
96 rfcomm->setMac( it.data()->mac() ); 96 rfcomm->setMac( it.data()->mac() );
97 rfcomm->setChannel( it.data()->channel() ); 97 rfcomm->setChannel( it.data()->channel() );
98 rfcomm->setComment( it.data()->comment() ); 98 rfcomm->setComment( it.data()->comment() );
99 } 99 }
100 /* Use rfcomm.conf directly for now 100 /* Use rfcomm.conf directly for now
101 * rfcomm->setMac( cfg.readEntry( "mac", "" ) ); 101 * rfcomm->setMac( cfg.readEntry( "mac", "" ) );
102 * rfcomm->setChannel( cfg.readNumEntry( "channel", 1 ) ); 102 * rfcomm->setChannel( cfg.readNumEntry( "channel", 1 ) );
103 * rfcomm->setComment( cfg.readEntry( "comment", "" ) ); 103 * rfcomm->setComment( cfg.readEntry( "comment", "" ) );
104 */ 104 */
105 } 105 }
106} 106}
107 107
108 108
109void RfcommAssignDialog::saveConfig() 109void RfcommAssignDialog::saveConfig()
110{ 110{
111 111
112 //Config cfg( "bluetoothmanager-rfcommbind" ); 112 //Config cfg( "bluetoothmanager-rfcommbind" );
113 113
114 QMap< int, RfcommDialogItem*>::Iterator it; 114 QMap< int, RfcommDialogItem*>::Iterator it;
115 115
116 QMap< QString, RfCommConfObject*> outMap; 116 QMap< QString, RfCommConfObject*> outMap;
117 117
118 for( it = m_itemList.begin(); it != m_itemList.end(); ++it ) 118 for( it = m_itemList.begin(); it != m_itemList.end(); ++it )
119 { 119 {
120 120
121 //cfg.setGroup( QString("%1").arg( it.key() ) ); 121 //cfg.setGroup( QString("%1").arg( it.key() ) );
122 RfcommDialogItem *rfcomm = it.data(); 122 RfcommDialogItem *rfcomm = it.data();
123 123
124 124
125 outMap.insert( QString( "%1").arg( it.key() ), new RfCommConfObject( it.key(), rfcomm->mac(), rfcomm->channel(), rfcomm->comment() ) ); 125 outMap.insert( QString( "%1").arg( it.key() ), new RfCommConfObject( it.key(), rfcomm->mac(), rfcomm->channel(), rfcomm->comment() ) );
126 126
127 127
128 //cfg.writeEntry( "mac", rfcomm->mac() ); 128 //cfg.writeEntry( "mac", rfcomm->mac() );
129 //cfg.writeEntry( "channel", rfcomm->channel() ); 129 //cfg.writeEntry( "channel", rfcomm->channel() );
130 //cfg.writeEntry( "comment", rfcomm->comment() ); 130 //cfg.writeEntry( "comment", rfcomm->comment() );
131 } 131 }
132 132
133 confHandler->save( outMap ); 133 confHandler->save( outMap );
134 134
135} 135}
diff --git a/noncore/net/opietooth/manager/rfcommconfhandler.cpp b/noncore/net/opietooth/manager/rfcommconfhandler.cpp
index 20453e8..2ef95ff 100644
--- a/noncore/net/opietooth/manager/rfcommconfhandler.cpp
+++ b/noncore/net/opietooth/manager/rfcommconfhandler.cpp
@@ -47,68 +47,68 @@ RfCommConfHandler::RfCommConfHandler( const QString & filename ) {
47RfCommConfHandler::~RfCommConfHandler() { 47RfCommConfHandler::~RfCommConfHandler() {
48 48
49} 49}
50 50
51void RfCommConfHandler::save( QMap<QString, RfCommConfObject*> devices ) { 51void RfCommConfHandler::save( QMap<QString, RfCommConfObject*> devices ) {
52 52
53 QFile rfCommConf( "/tmp/test" ); 53 QFile rfCommConf( "/tmp/test" );
54 QTextStream outStream( &rfCommConf ); 54 QTextStream outStream( &rfCommConf );
55 if ( rfCommConf.open( IO_WriteOnly ) ) { 55 if ( rfCommConf.open( IO_WriteOnly ) ) {
56 56
57 QMap<QString, RfCommConfObject*>::Iterator it; 57 QMap<QString, RfCommConfObject*>::Iterator it;
58 for( it = devices.begin(); it != devices.end(); ++it ) { 58 for( it = devices.begin(); it != devices.end(); ++it ) {
59 outStream << "rfcomm" + QString("%1").arg( it.data()->number() ) + " {\n"; 59 outStream << "rfcomm" + QString("%1").arg( it.data()->number() ) + " {\n";
60 outStream << " device " + it.data()->mac() + ";\n"; 60 outStream << " device " + it.data()->mac() + ";\n";
61 outStream << " channel " + QString( "%1" ).arg( it.data()->channel() ) + ";\n"; 61 outStream << " channel " + QString( "%1" ).arg( it.data()->channel() ) + ";\n";
62 outStream << " comment \"" + it.data()->comment() + "\";\n"; 62 outStream << " comment \"" + it.data()->comment() + "\";\n";
63 outStream << "}\n\n"; 63 outStream << "}\n\n";
64 } 64 }
65 65
66 rfCommConf.close(); 66 rfCommConf.close();
67 } 67 }
68} 68}
69 69
70 70
71QMap<QString, RfCommConfObject*> RfCommConfHandler::foundEntries() { 71QMap<QString, RfCommConfObject*> RfCommConfHandler::foundEntries() {
72 return m_foundEntries; 72 return m_foundEntries;
73} 73}
74 74
75void RfCommConfHandler::load() { 75void RfCommConfHandler::load() {
76 76
77 QFile rfCommConf( m_filename ); 77 QFile rfCommConf( m_filename );
78 if ( rfCommConf.open( IO_ReadOnly ) ) { 78 if ( rfCommConf.open( IO_ReadOnly ) ) {
79 79
80 QStringList list; 80 QStringList list;
81 QTextStream inStream( &rfCommConf ); 81 QTextStream inStream( &rfCommConf );
82 list = QStringList::split( "\n", inStream.read() ); 82 list = QStringList::split( "\n", inStream.read() );
83 83
84 QString number; 84 QString number;
85 QString mac; 85 QString mac;
86 QString channel; 86 QString channel;
87 QString comment; 87 QString comment;
88 88
89 for ( QStringList::Iterator line=list.begin(); line != list.end(); line++ ) { 89 for ( QStringList::Iterator line=list.begin(); line != list.end(); line++ ) {
90 90
91 QString tmpLine = ( *line ).stripWhiteSpace(); 91 QString tmpLine = ( *line ).stripWhiteSpace();
92 92
93 if ( tmpLine.startsWith("rfcomm") ) { 93 if ( tmpLine.startsWith("rfcomm") ) {
94 QString number = tmpLine.mid( 6,1 ); 94 QString number = tmpLine.mid( 6,1 );
95 qDebug( tmpLine ); 95 odebug << tmpLine << oendl;
96 qDebug( "TEST " + number ); 96 odebug << "TEST " + number << oendl;
97 } else if ( tmpLine.startsWith( "}" ) ) { 97 } else if ( tmpLine.startsWith( "}" ) ) {
98 m_foundEntries.insert( number, new RfCommConfObject( number.toInt(), mac, channel.toInt(), comment ) ); 98 m_foundEntries.insert( number, new RfCommConfObject( number.toInt(), mac, channel.toInt(), comment ) );
99 } else if ( tmpLine.startsWith( "device" ) ) { 99 } else if ( tmpLine.startsWith( "device" ) ) {
100 mac = tmpLine.mid( 7, 17 ); 100 mac = tmpLine.mid( 7, 17 );
101 qDebug( "mac" + mac ); 101 odebug << "mac" + mac << oendl;
102 } else if ( tmpLine.startsWith( "channel" ) ) { 102 } else if ( tmpLine.startsWith( "channel" ) ) {
103 channel = tmpLine.mid( 8, 1 ); 103 channel = tmpLine.mid( 8, 1 );
104 qDebug ( "Channel :" + channel ); 104 qDebug ( "Channel :" + channel );
105 } else if ( tmpLine.startsWith( "comment" ) ) { 105 } else if ( tmpLine.startsWith( "comment" ) ) {
106 comment = tmpLine.mid( 9, tmpLine.find( ';' ) - 9 - 1 ); 106 comment = tmpLine.mid( 9, tmpLine.find( ';' ) - 9 - 1 );
107 qDebug( "Comment: " + comment ); 107 odebug << "Comment: " + comment << oendl;
108 } 108 }
109 } 109 }
110 rfCommConf.close(); 110 rfCommConf.close();
111 } 111 }
112 save( m_foundEntries ); 112 save( m_foundEntries );
113 qDebug( QString( "ENTries: %1").arg( m_foundEntries.count() ) ); 113 odebug << QString( "ENTries: %1").arg( m_foundEntries.count() ) << oendl;
114} 114}
diff --git a/noncore/net/opietooth/manager/rfcpopup.cpp b/noncore/net/opietooth/manager/rfcpopup.cpp
index 04bfe48..01ad616 100644
--- a/noncore/net/opietooth/manager/rfcpopup.cpp
+++ b/noncore/net/opietooth/manager/rfcpopup.cpp
@@ -1,103 +1,103 @@
1 1
2#include "pppdialog.h" 2#include "pppdialog.h"
3#include "rfcpopup.h" 3#include "rfcpopup.h"
4#include "rfcommassigndialogimpl.h" 4#include "rfcommassigndialogimpl.h"
5 5
6/* OPIE */ 6/* OPIE */
7#include <qpe/qpeapplication.h> 7#include <qpe/qpeapplication.h>
8 8
9/* QT */ 9/* QT */
10#include <qtimer.h> 10#include <qtimer.h>
11 11
12using namespace OpieTooth; 12using namespace OpieTooth;
13 13
14/* 14/*
15 * c'tor init the QAction 15 * c'tor init the QAction
16 */ 16 */
17RfcCommPopup::RfcCommPopup( OpieTooth::BTDeviceItem* item ) 17RfcCommPopup::RfcCommPopup( OpieTooth::BTDeviceItem* item )
18 : QPopupMenu() 18 : QPopupMenu()
19{ 19{
20 qWarning("RfcCommPopup c'tor"); 20 owarn << "RfcCommPopup c'tor" << oendl;
21 21
22 QAction* a; 22 QAction* a;
23 23
24 24
25 m_item = item; 25 m_item = item;
26 26
27 /* connect action */ 27 /* connect action */
28 a = new QAction( ); // so it's get deleted 28 a = new QAction( ); // so it's get deleted
29 a->setText("Connect"); 29 a->setText("Connect");
30 a->addTo( this ); 30 a->addTo( this );
31 connect( a, SIGNAL( activated() ), 31 connect( a, SIGNAL( activated() ),
32 this, SLOT( slotConnect() ) ); 32 this, SLOT( slotConnect() ) );
33 33
34 34
35 /* disconnect action */ 35 /* disconnect action */
36 a = new QAction( ); 36 a = new QAction( );
37 a->setText("Disconnect"); 37 a->setText("Disconnect");
38 a->addTo( this ); 38 a->addTo( this );
39 connect( a, SIGNAL( activated() ) , 39 connect( a, SIGNAL( activated() ) ,
40 this, SLOT( slotDisconnect() ) ); 40 this, SLOT( slotDisconnect() ) );
41 41
42 42
43 /* foo action */ 43 /* foo action */
44 a = new QAction( ); 44 a = new QAction( );
45 a->setText("Bind table"); 45 a->setText("Bind table");
46 a->addTo( this ); 46 a->addTo( this );
47 connect( a, SIGNAL( activated() ), 47 connect( a, SIGNAL( activated() ),
48 this, SLOT( slotBind() ) ); 48 this, SLOT( slotBind() ) );
49 49
50 50
51 /* bar action */ 51 /* bar action */
52 a = new QAction( ); 52 a = new QAction( );
53 a->setText( "Bar" ); 53 a->setText( "Bar" );
54 a->addTo( this ); 54 a->addTo( this );
55 connect( a, SIGNAL( activated() ), 55 connect( a, SIGNAL( activated() ),
56 this, SLOT( slotBar() ) ); 56 this, SLOT( slotBar() ) );
57 57
58}; 58};
59 59
60 60
61RfcCommPopup::~RfcCommPopup() 61RfcCommPopup::~RfcCommPopup()
62{ 62{
63 /* delete m_con; 63 /* delete m_con;
64 delete m_dis; 64 delete m_dis;
65 delete m_foo; 65 delete m_foo;
66 delete m_bar; */ 66 delete m_bar; */
67} 67}
68 68
69 69
70void RfcCommPopup::slotConnect() 70void RfcCommPopup::slotConnect()
71{ 71{
72 72
73 qWarning("connect"); 73 owarn << "connect" << oendl;
74 74
75 PPPDialog pppDialog; 75 PPPDialog pppDialog;
76 QPEApplication::execDialog( &pppDialog ); 76 QPEApplication::execDialog( &pppDialog );
77} 77}
78 78
79 79
80void RfcCommPopup::slotDisconnect() 80void RfcCommPopup::slotDisconnect()
81{ 81{
82 qWarning("slot disconnected"); 82 owarn << "slot disconnected" << oendl;
83} 83}
84 84
85 85
86void RfcCommPopup::slotBind() 86void RfcCommPopup::slotBind()
87{ 87{
88 RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp ); 88 RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp );
89 89
90 rfcommAssign.newDevice( m_item->mac() ); 90 rfcommAssign.newDevice( m_item->mac() );
91 91
92 if ( QPEApplication::execDialog( &rfcommAssign ) == QDialog::Accepted ) 92 if ( QPEApplication::execDialog( &rfcommAssign ) == QDialog::Accepted )
93 { 93 {
94 rfcommAssign.saveConfig(); 94 rfcommAssign.saveConfig();
95 } 95 }
96} 96}
97 97
98 98
99void RfcCommPopup::slotBar() 99void RfcCommPopup::slotBar()
100{ 100{
101 qWarning("slotBar"); 101 owarn << "slotBar" << oendl;
102}; 102};
103 103
diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp
index c8ea3e3..3b005c4 100644
--- a/noncore/net/opietooth/manager/scandialog.cpp
+++ b/noncore/net/opietooth/manager/scandialog.cpp
@@ -110,52 +110,52 @@ namespace OpieTooth {
110 110
111 } 111 }
112 112
113 void ScanDialog::stopSearch() { 113 void ScanDialog::stopSearch() {
114 m_search = true; 114 m_search = true;
115 } 115 }
116 116
117 void ScanDialog::fillList(const QString&, RemoteDevice::ValueList deviceList) { 117 void ScanDialog::fillList(const QString&, RemoteDevice::ValueList deviceList) {
118 progress->setProgress(0); 118 progress->setProgress(0);
119 progressStat = 0; 119 progressStat = 0;
120 QCheckListItem * deviceItem; 120 QCheckListItem * deviceItem;
121 121
122 RemoteDevice::ValueList::Iterator it; 122 RemoteDevice::ValueList::Iterator it;
123 for( it = deviceList.begin(); it != deviceList.end(); ++it ) { 123 for( it = deviceList.begin(); it != deviceList.end(); ++it ) {
124 124
125 deviceItem = new QCheckListItem( ListView1, (*it).name(), QCheckListItem::CheckBox ); 125 deviceItem = new QCheckListItem( ListView1, (*it).name(), QCheckListItem::CheckBox );
126 deviceItem->setText( 1, (*it).mac() ); 126 deviceItem->setText( 1, (*it).mac() );
127 } 127 }
128 m_search = false; 128 m_search = false;
129 StartStopButton->setText( tr( "Start scan" ) ); 129 StartStopButton->setText( tr( "Start scan" ) );
130 } 130 }
131 131
132/** 132/**
133 * Iterates trough the items, and collects the checked items. 133 * Iterates trough the items, and collects the checked items.
134 * Then it emits it, so the manager can connect to the signal to fill the listing. 134 * Then it emits it, so the manager can connect to the signal to fill the listing.
135 */ 135 */
136 void ScanDialog::emitToManager() { 136 void ScanDialog::emitToManager() {
137 137
138 if (!ListView1) { 138 if (!ListView1) {
139 return; 139 return;
140 } 140 }
141 141
142 QValueList<RemoteDevice> deviceList; 142 QValueList<RemoteDevice> deviceList;
143 143
144 QListViewItemIterator it( ListView1 ); 144 QListViewItemIterator it( ListView1 );
145 for ( ; it.current(); ++it ) { 145 for ( ; it.current(); ++it ) {
146 if ( ( (QCheckListItem*)it.current() )->isOn() ) { 146 if ( ( (QCheckListItem*)it.current() )->isOn() ) {
147 RemoteDevice device( it.current()->text(1), it.current()->text(0) ); 147 RemoteDevice device( it.current()->text(1), it.current()->text(0) );
148 deviceList.append( device ); 148 deviceList.append( device );
149 } 149 }
150 } 150 }
151 emit selectedDevices( deviceList ); 151 emit selectedDevices( deviceList );
152 } 152 }
153 153
154/** 154/**
155 * Cleanup 155 * Cleanup
156 */ 156 */
157 ScanDialog::~ScanDialog() { 157 ScanDialog::~ScanDialog() {
158 qWarning("delete scan dialog"); 158 owarn << "delete scan dialog" << oendl;
159 delete localDevice; 159 delete localDevice;
160 } 160 }
161} 161}